corrected the function swap for values