fixes to make HTML output work for sorting and score calculation