public int linkIndexForNode(int id){
        // check for existence of lookup 
        if(TM != null)
        {
            return (Integer)TM.get(id);
        }
        
        if(link == null)
        {
            return -1;
        }
        Link L = link;
        if(L.node.id == id)
        {
            return 0;
        }
        int counter = 1;
        while(L.hasNext()){
            L = L.next;
            if(L.node.id == id)
            {
                return counter;
            }
            counter++;
        }
        return -1;
    }