resort some code