first attempt a more complete raft model, not working atm due to lack of mutually recursive functions :), needs re-thinking a bit