how does a cnc lathe machine work