removed multiple if (xxx) break in for loop, added goto. better solution is to simply lower number of for loops.