Rail machine