corrected a bug in for loop (they took init with a string instead of an int)