Gh394 git history

#394
because I want to calculate the length only once in "for" structure.