some more cleanup
Added first draft for setting the tag-sort attribute in th after sorting