modify main func