worked on compareTo