Building the main() function