forgot to free matrix.