KOtlin State Machine