still working on tally functions