list item counting added to both unordered lists
abstracted the list item counts into a function