small changes to facilitate output to csv, also there maybe an error in the confusion matrix accuracy code