Use queue not stack.