Fixed compareTo() and tested