Started on the simulation function