Changing output to CSV, adding plotting script.