added pred2prob, treefinder and new matrix creation code