added an overload for hashCode and equals