Created method to swap to values in list