Completes the confusion matrix code