working openmp code, reverted to before I added outputXProb function which seems to have broken things