add helper for swap two values in array