public synchronized String toString()
    {
        StringBuilder buffer = new StringBuilder();
        buffer.append("Local: ").append(getLocalNode()).append("\n");
        
        int alive = 0;
        int dead = 0;
        int unknown = 0;
        
        for(Bucket bucket : getAllBuckets())
        {
            buffer.append(bucket).append("\n");
            
            for (Contact node : bucket.getAllBucketContacts())
            {
                if (node.isAlive())
                {
                    alive++;
                }
                else if (node.isDead())
                {
                    dead++;
                }
                else
                {
                    unknown++;
                }
            }
            
            for (Contact node : bucket.getAllCachedContacts())
            {
                if (node.isAlive())
                {
                    alive++;
                }
                else if (node.isDead())
                {
                    dead++;
                }
                else
                {
                    unknown++;
                }
            }
        }
        
        buffer.append("Total Buckets: ").append(bucketTrie.size()).append("\n");
        buffer.append("Total Active Contacts: ").append(getAllBucketContacts().size()).append("\n");
        buffer.append("Total Cached Contacts: ").append(getAllCachedContacts().size()).append("\n");
        buffer.append("Total Alive Contacts: ").append(alive).append("\n");
        buffer.append("Total Dead Contacts: ").append(dead).append("\n");
        buffer.append("Total Unknown Contacts: ").append(unknown);
        return buffer.toString();
    }