adding simulation and continuation method code