override equals;hashcode. Implemented comparable