added function tally