Update Matrix resize function