update the main program