Working finite state controller