updated equalsMethod