Changed compareTo to __cmp__