transposed th in for loop

Spelling error in `length`