adding the legend buttons