Profiles the main function