creates to_matrix method