* use class to hold state machine