creating the mathmatical and graphical model of the cart