Implemented contains and isPrefix