main function file