declare vars outside of loop