how code could be executed before or after main function