add filter button functions & legend