updated hashCode and equals methods