error also appears if there is a missing semicolon or whatever, I do not think it really helps here.I was able to increase the performance dramatically by using an array with just two rows, as the values of each hierarchy level are only dependent on its child-level.Though I still think it is bad style of coding to do it statically.