sort a stack with a temp stack