Split up the grid search function, reverting back to the structure as in the 1.2 line.
Authored by: bugman 2008-03-23
Parent: [r5173]
Child: [r5175]