add re-order function