public synchronized void replaceContactInBucket(Bucket bucket, Contact node)
    {
        if (node.isAlive())
        {
            Contact leastRecentlySeen = bucket.getLeastRecentlySeenBucketContact();
            
            //The LRS node can be replaced if it is not the local node, AND it is DEAD
            if (!isLocalNode(leastRecentlySeen) && (leastRecentlySeen.isDead()))
            {
                //replace the node in the bucket
                bucket.removeBucketContact(leastRecentlySeen.getNodeId());//remove the LRS node from the bucket
                bucket.addBucketContact(node);//add the new node to the bucket
                touchBucket(bucket);
                
                return;
            }
        }
        addContactToBucketCache(bucket, node);
        try
        {
        	controlNode.ping(bucket.getLeastRecentlySeenBucketContact());
        }
        catch(IOException ioe)
        {
        	//log
        	System.err.println("Error in ping");
        }
    }