Improvements in the simulation code of the SOX experiment