Simplify for loop iteration rewrite code somewhat
Remove some cruft