add simulation code