adding legend and content