added stdflush to avoid accident broken pipe, sorted htmlreport list ahead of report generation and explained the purpose a bit further