updated to check equality