modified output format and added some output.