completed solution to swap ii