ported writeResultsHeader function