Bug-fixing and finishing HTML generation (not done yet)