Moore State Machine example