I am beyond stumped on this one..

Here is the code I am executing.

```
   var Category = [];

    //START OF VARIABLES

    var ID1;
    var ID2;
    var ID3;
    var ID4;
    var ID5;

    var temp1;
    var temp2;
    var temp3;
    var temp4;
    var temp5;

    var extracats2;

    var Level2CatsLen;
    var Level3CatsLen;
    var Level4CatsLen;
    var Level5CatsLen;

    var Level2Children = [];
    var Level3Children = [];
    var Level4Children = [];
    var Level5Children = [];

    //END OF VARIABLES

        var dispatchMouseEvent = function(target, var_args) {
                var e = document.createEvent("MouseEvents");
        e.initEvent.apply(e, Array.prototype.slice.call(arguments, 1));
        target.dispatchEvent(e);
                target.addEventListener("click",Level2CatsLen = GetLevel2, true);

    }

    var Level1Cats = document.getElementsByClassName("p-pstctgry-lnk-ctgry "); //GETTING LEVEL 1 CATS

    var Level1CatsLen = Level1Cats.length; //GETTING LEVEL 1 CAT LEN

        function GoToLevel2(n) { //GO TO NEXT LEVEL!
        setTimeout(function() {
        ID1 = Level1Cats[n].id;
        temp1 = Level1Cats[n].innerHTML;
        temp1 = temp1.replace(/&amp;/gi, "&").replace(/<[^>]*>/gi, "").replace(/<[^>]*>/gi, "");
        console.log(temp1);
        dispatchMouseEvent(Level1Cats[n], "mouseover", true, true);
        dispatchMouseEvent(Level1Cats[n], "click", true, true);
        }, i*2000);
        }

        function GoToLevel3(n) { //GO TO NEXT LEVEL!
        setTimeout(function() {
        ID2 = Level1Cats[n].id;
        temp2 = Level1Cats[n].innerHTML;
        temp2 =temp2.replace(/&amp;/gi, "&").replace(/<[^>]*>/gi, "").replace(/<[^>]*>/gi, "");
        console.log(temp2);
        dispatchMouseEvent(Level3Cats[n], "mouseover", true, true);
        dispatchMouseEvent(Level3Cats[n], "click", true, true);
        }, i*1500);
        }

        function GetLevel2() { 
        setTimeout(function() {
            Level2Children = [];
        Level2Cats = document.getElementsByClassName("p-pstctgry-lnk-ctgry");
        console.log("Level1CatLen: "+Level1CatsLen);
        var Level2CatsLen = Level2Cats.length
        console.log("Level2CatLen: "+Level2CatsLen);

        extracats2 = Level2CatsLen - Level1CatsLen;
        console.log("EXTRACATS2: "+extracats2);

            console.log("TRYING CAT 2");

            //#### LEVEL 3 ####
            for (ii = 0; ii < extracats2; ii++) {
            if (extracats2 < 2) {
            alert("lel");
                GoToLevel3(ii);     

            Level2Children.push(Level2Cats[ii+Levael1CatsLen].id);
            }

        //DO SOMETHING WITH CATEGORIES - Level 1

        Category.push({Name: temp1, ID: ID1, ParentID: 'null', ChildrenIDs: Level2Children});
        console.log("LELLELLEL");
        //FINISH

        return Level2CatsLen;
        }},3000);
        }

    //THE ACTUAL METHOD!

        for (i = 0; i <= Level1CatsLen-1; i++) {
        //#### LEVEL 2 ####
        GoToLevel2(i);

        // END OF LEVEL 1
    }

```

It kind of runs as intended..

So it gets to the following for loop but for some reason doesn't meet the condition.

```
//#### LEVEL 3 ####
for (ii = 0; ii < extracats2; ii++) {
if (extracats2 < 2) {
alert("lel");
    GoToLevel3(ii);     

Level2Children.push(Level2Cats[ii+Levael1CatsLen].id);
}

```

As you can see I have an alert in there but it never actually does it.

I get an output above of extracats that says all of them except one category are above 2 and hence should execute the following code within the for loop. Though it does..

Any ideas?