Create main function.