Finished the compareTo method