extended the shopping function