Turned the new totalHours function into a generator.