using vector and matrix from `mat`