Updated to add equals() and hashCode() methods