added window.resize rAF handling boilerplate