for loop needed a length