Added in n_cores functionality for grid search and fixed some bugs