added equals(Object) and hashcode() methods