Second draft of the decision module. No brain but all the state machines working and tested.