first version of compareTo