added var in loops