updated the functionality for the categories and removal