Moving out index variable