Revert "Updated rearrangements detection."

This reverts commit e79fc5e901448070cdf56702d1411ae95d5db362.