fixing for loop variables.