sort a stack in ascending order