Added legend using the titles. Added control div