Finished functionality of sort by category.