added grid search