change in compareTo and some bug fix