added equals and hashCode methods.