changed the disk file write function (matrix2DToDisk) into C++ semantics, minor tweaks