Updated gridSearch to use the cartesian-product funtion from itertools, refactored grid generation