Reimplement ticket machine