This program uses very convoluted logic. I would not mess with it at all. What they do with foo[] is just criminal.