Updated for loop with .length