changed grid search