renamed, and updated initialization of main function.