loop reversal