updated grid search