added a legend to the plot