Corrected html
Added documentation
Cleaned up code.