script to run factor models on the grid