simplified contains - removed premature optimization