implementation of contains