main func modify