Made main() reentrant by using local vars instead of global readonly vars.
Made main() reentrant by using local vars instead of global readonly vars.

spectrals/stackexchange-answers,mbrukman/stackexchange-answers,spectrals/stackexchange-answers,mbrukman/stackexchange-answers