You wouldn't have guessed that the bottom-most "level[i] = 0.f;" line was actually required. It even confused cppcheck.