function reordering