fix tie breaking mechanism; HTML output much more shiny