Added length for loop iteration