Change to use Stack<Integer> in map