creating a smarter cart