Change resizing algorithm