A method `sortStack()` arranges an unsorted stack in descending order.
But when I try to use the method for 2 individual stacks, the second sorted stack gets merged with the first sorted stack. Can anyone help with what I am missing? 

```
    static Stack<Integer> descending = new Stack<Integer>();
    static Stack<Integer> tmpStack = new Stack<Integer>();

    public static Stack<Integer> sortStack(Stack<Integer> input){

    while(!input.isEmpty()) {
        int tmp = input.pop();
        while(!tmpStack.isEmpty() && tmpStack.peek() > tmp) {
            input.push(tmpStack.pop());
        }
        tmpStack.push(tmp);
    }

    while(!tmpStack.isEmpty()) {
        descending.push(tmpStack.pop());
    }
    return descending;
}

public static void main(String args[]){

            Stack<Integer> A = new Stack<Integer>(); 
            A.push(34); 
            A.push(3); 
            A.push(31);

            System.out.println("unsorted: " + A);
            Stack<Integer> C = sortStack(A);
            System.out.println("sorted: " + C);

            Stack<Integer> B = new Stack<Integer>();
            B.push(1); 
            B.push(12); 
            B.push(23);

            System.out.println("unsorted: " + B);
            Stack<Integer> D = sortStack(B);
            System.out.println("sorted: " + D);        
        }

```

**Output**

```
unsorted: [34, 3, 31]

sorted: [34, 31, 3]

unsorted: [1, 12, 23]

sorted: [34, 31, 3, 23, 12, 1]

```