Modifying how the HTML is generated together with javascript and css and minor bug fixes