Added equals and hashCode methods.