Adds function to swap two values in 2D array