more progress on resize logic