Remove unneeded matrix data