matrix resizing handled