reinstated local copy of resize helper