added per trial diagnostics as an option (see trial.php line 310)
fixed potential shuffling problem using original shuffle

address for loop index issue
Merge branch 'errorCheck'