commented code. added the confusion matrix