Since this is only used inside the loop, why don't you move it into it.
tempFirstLevelList and tempSecondLevelList can be misleading to one to think that you only look at 2 levels, how about naming something like tempLevelList and tempNextLevelList, if you used recursion you probably wouldn't need these variables in the first place