sorting as items and as categories