Private equals method