implementation for rsearch