correct matrix construction