simplified flow of control in main