fixing main program.