added states for for loop