add inserting of function definitions after main