https://profilbaru.com/article/Finite-state_machine