Added optimized_main.c file. Localized reference variables