Function: checkout

Modified checkout function.