added swapping function for exercise 1 Day 2