finished working version of confusion matrix script