general structure of main program done