adding the legend