Added counts table output

- Counts table output added to output html
Minor code change

- Reordered one line of code for consistency.