def extractLeafs(nt, leafDict):
    """Given a newick tree object, it returns a dict of
    leaf objects. Operates recursively.
    """
    if nt is None:
        return None
    nt.distance = 0
    if nt.right is None and nt.left is None:
        leafDict[nt.iD] = True
    else:
        extractLeafs(nt.right, leafDict = leafDict)
        extractLeafs(nt.left , leafDict = leafDict)