Cleaned up the html and added a legend