corrected equals method.