added destructuring in for loops