Implemented equals() and compareTo()