implement function of getting linked list length