Updated main program