reflow function