more standard state machi9ne