sort stack in ascending order