implementing finite state machine

see finiteStateMachine.rtf for deets