Implemented equals(Object obj) and hashCode methods
resolving conflicts