Modified unitayr_matrix to make it shorter