Simplified contains() method