Refactoring the cart calculation a little to make use of events, fixed a bug in the cart calculation as well