added equals and hashcode methods to several classes