Consolidated old checkout code, added stashing for checkout