Use cmp to sort items