updated equals method