main function file.