still working on get_tally function