starting of grid search