create main function