working on resize function