trying to restart the adjacent loop after swapping