demonstrates using the legend