a very inefficient way to order per categories