create compareTo method and all tests pass