implemented the equality operator