totally rewrote officiate, with better nested pattern matching