tally-repeat first pass refactoring completed