for loop nonsense fix