code in "Simulation Techniques in Financial"