finish the function grid_cart