shopping cart sum refactored