cart function 1st implement