Added system exit, and output results to file.