Tallying logic close to working