revised cart implementation