made foes sorting optional