adds category and sorts