Little improvement on resize script