Add grid search option