edit the main func