modify main function