modified swap location selection to match assigned types