final changes before removing matrices