got rid of plyr dependency in grid search