Starting simulation code.