declared variables privately in all for loops