how does a cart work