create method consolidateCard, which delets duplicates in a cart and adds a count key to each item