Add support for basic grid search