Final working version of html generator