Reworked the grid search exercise