used non-lib fn to find length of list