FOR loop partially implemented