finished updating code to use downloadsTree
added lib implementation file