Added confusion matrix integration.

Bug remains in pop out functionality but otherwise integrated.