Added logic for checkout