added function to output Xprobs.out