function for calculating confusion matrix added