repaced variable access by var(i)