Implemented primitive search function