Add some comments for checkout function.