html fixes
fix descending custom sorting (and simplified the code a little bit)