refactors mastermind
adds docco docs