Moved compareTo, added equals and hashcode