add fmatrix in, todo add buffer file