setting up show_by_category function