added swapping of values as well!