avoid variable name conflict for swap