add utility for matrices and vector