added to_array to matrix