updated ForLoop's to work with new version