Added inserting of sum row after every transaction group. Not finished; very wordy.