trying to get fsm working