Changing Gridsearch to be recursive.
Applying updates elsewhere in code for new gridsearch minimizer.