forgot to free all matrix elements