move variable init out of loop