Turn countItems utility into a dInventory method.