Added row swap function