Added checkout function