implement basic random search