Updated resizing of Matrix