generating html on the server
fixing sort order