Changed formatting and made program output to file.