#181: this is one solution. maybe compareTo is better
#181: fixes an issue with comparing doubles