Move the calculation of the exchange hash to above the various