iterative, use 1 stack