Entry point for application
Corrected array iteration, cosmetic rearrangement of variables