fixed up html templated and cleaned up so it mostly works now