resize to ensure algorithm gets what it expects.