more accurate resizing