maintain matrix X