Fixed Main program.