Modified code for 3-way exchange results.