Adding a finite state machine implementation.