report generated mostly correctly, only heavy refactoring and edge cases left