Add resizing algorithm