ProjectBrainweaver: tallying algorithm