turn machine optimization