added Checkout function - pg.159