Initial simulation code