added state_machine and basic states