added function reorder-by