figuring out how to mimmick state machine