write crazy sort callback.