Implement destroyLinkList() and length() function