Automatically resizing algorithm is more accurate