move sort to adv data struct