The generateReport routine now seems to echo the result directly rather than return it