length of list with loop