Because the first time it is run, the value of $linksUsed is 1, which is set on line 4. After the first run, the value will be 2, then 3 and so on. Which means that on the first iteration of your for loop, $linksreturn will be set to $addonfromHere and it will ignore the else statement.
To...