Create main function for invoke.