added BIDMat_UTILS.cpp