added legend to plot