add some code for machine