updated the main program