Try debugging your code by adding some printlns to show the values of all the variables as they are set and tested.
For example assign the values returned by the get methods to variables and print...