modify the main function part