Fixed a memory leak, cleaned up HTML
Working HTML output as