loops within loops in the tally method. But I think it's working.