making slave machine class
added step function