Create main function