updated to show the legend