for matrix