def findFinger(node, key): current=node for x in range(k): if distance(current.id, key) > \ distance(node.finger[x].id, key): current=node.finger[x] return current def lookup(start, key): current=findFinger(start, key) next=findFinger(current, key) while distance(current.id, key) > \ distance(next.id, key): current=next next=findFinger(current, key) return current