updated random search so that it could be run from any directory