Cleaned up js code. added html formating.