just working on the simulation code