Solved Grocery Problem