align_order2 function

Reorders layout observations based on specific statistics.