implemented random search