Profile the main function