Applied the copy and swap pattern