Small modification to the mathematica script