// optimized resizing of rows