The following is excerpted from "Basic Brown: My Life and Our Times" by Willie Brown, which publishes Feb. 5, the date of the California primary. Gleaned from three years of intense conversation between Willie Brown and former Examiner columnist P.J. Corkery, it seems a realistic portrayal of our former mayor - healthy ego, frank speaker, master politician - and would serve well as a primer for anyone running for office. It's also highly entertaining. His advice on romantic scandal - admit it, embrace it and move on - will be pertinent for a good long time. We chose to run the chapter on homelessness and Muni because it's just as relevant today as it was under Willie's reign.

San Francisco is a city that really cares about people. It wishes to be as generous, as socially conscious, as it can be. So for 25 years, ever since the closing of state mental facilities and the influx of addictive drugs began to drive afflicted people out onto the streets where they lived homelessly, the city has tried to do its best for these people. Cash grants, a vast array of social services, and a lenient attitude about people camping out in parks and on streets marked San Francisco's approach. Instead of ameliorating the condition of these afflicted people, this policy seemed only to increase their numbers and the danger, distress, and demoralization of the whole population.

In 1993 my predecessor (and in 1995, my opponent for the mayoralty), Frank Jordan, began a program called Matrix to get the homeless off the streets. Reflecting Jordan's origins as a career police officer, Matrix was essentially a police action, an aggressive police action designed to displace the homeless from their spots on the streets and in the parks. It was unsuccessful and also awfully unpopular with much of the city's population, who saw it as nearly brutal and not much of a social solution. Matrix was a major issue during the 1995 mayoral campaign.

I campaigned honestly and accurately against Matrix. Matrix helped defeat Jordan. It seemed to me and to thousands of others that homelessness could be more effectively addressed through something more helpful to the homeless than law enforcement. I earnestly believed that we could do more than displace already placeless people. I was sure we could in fact do the job of freeing people of the horror of having to live on the streets. I thought there was a real possibility we could do that. I was naive.

Once I became mayor, it soon became painfully clear to me that three-fourths of the folk living out there on the streets were out there without any possibility of ever getting off the streets. Not because there was no opportunity. Not because there was no shelter or housing available. Not because there were not enough mental health programs. Not because there were no drug abuse programs. We were providing those and, of course, we could do more. The will to provide services and shelter was there.

I discovered factors - some bureaucratic, some political - working in a kind of evil synthesis with each other that really prevented the long-term homeless from entering the system. For one, the rules and regulations of the welfare system wouldn't let us require people to go into the treatment protocols or processes that could lead to their maybe breaking out of the cycle of poverty, hopelessness, homelessness. To me this was tantamount to condemning people to a prison of the streets.

Backing this up was a collection of so-called activists with heavy political clout who absolutely believed (and still believe) that homeless people should have a right to live on the street. They believed that homeless people had an absolute right to do everything they were doing, no matter how harmful to themselves or to the rest of the citizenry.

Opposing them was an army of businesspeople, small and large, who didn't want the homeless anywhere near them. Shop owners in the neighborhoods were furious, frustrated and fiery. Hotel owners and managers, of course, didn't want the homeless within sight of the tourists who come to San Francisco. These people wanted draconian action, they wanted law enforcement.

You had all sorts of deep division within the polity and no side capable of budging. It was a nightmare. Here was a more dire example of the situation I encountered on lesser problems: selfishness and self-righteousness preventing people from coming to serious dialogue. They wouldn't budge and you couldn't wedge them.

In the legislature and in general political conflicts, I usually had been able to nudge sides out of their selfishness by showing them how outrageous they were actually being. In this situation, especially with the so-called homeless advocates, they were feasting on their outrage. Their moral indignation was their very food. And self-righteousness is not on the menu at the bargaining table. The selfishness was astonishing to me.

Of course, I addressed the issue as best as I could - over years. You just couldn't have any dialogue, however. Activists would storm meetings. The businesspeople would flee. Without dialogue you can't reach a solution, no matter how many people are suffering however horribly on the streets. For trying, I became the object of outrage.

The criticism was heavy, political and personal. People raised questions about my commitment to my core values. Even my friends like John Burton and Gavin Newsom raised questions about whether or not I really cared. Had I not almost become a Republican because I was raising questions? People accused me of abandoning the problem when I was working daily to try and get a solution going. It was brutal.

People who really understood the problem were pilloried as well. My friend the Rev. Amos Brown, whom I had appointed to the city's legislature, came up with a program in 2000 to help people get out of the cycle of madness that was life on the streets. It would have provided shelter and services, and in return would have cut the monthly cash grants (then $395 a month) that homeless people got from the city. The cash, which was to help with rent and food, often was spent on drugs and booze. Amos Brown's plan redirected the cash to provide housing and help. For this he was roundly castigated. His plan failed at the polls. And his advocacy was crucial in ending his reelection bid.

But less than two years later, Gavin Newsom, also in the city legislature, came up with a similar plan. He gave it a sharp name, Care Not Cash. By then, chaos was on the streets as the plight and dangers presented by homelessness produced anger and disgust so great that the very people, in and out of the political establishment and the media, who had opposed Amos Brown's plan were supporting Newsom's. Care Not Cash passed and became law.

So in the end, the outrage moved. But by that time, I had become demonized, and my own efforts belittled. Despite Care Not Cash, homelessness persists as a great and serious problem on the streets of San Francisco. My own belief is that it will be a problem for San Francisco long after Mayor Newsom is reelected and completes a second term. The problem of homelessness is not going to be solved, in my opinion, until one major drastic change takes place in public policy: we have to be able to impose help and treatment on people. The homeless face major challenges, but they'll never get succor, support or a chance until we are able to force them into treatment. We all suffer today because of policies based on the premise that the homeless have a right to live in misery. That's not a right. That's cruel and unusual punishment. For us all.

Muni, or the San Francisco Municipal Railway, the agency that runs the city's cable cars, trolleys, buses and streetcars, was another massive nightmare. I had better results with Muni, but I didn't start out well. As I have already written earlier in the book, in the middle of the 1995 Mayoral campaign I announced that I would fix Muni in 100 days. Muni handled more than 750,000 boardings a day, but the 95-year-old system was deteriorating right in front of everybody's eyes.

I was convinced that everything that needed doing could be done within 100 days. I knew the public, frustrated by ever-worsening service, ever-deteriorating equipment and increasingly indifferent employees, desperately wanted Muni to be fixed. Even the employees were desperate for improvement. Most had pride in their work and in Muni, and they hated dealing with a frustrated ridership. But my "100 days" announcement was a line that I would live to regret.

At the time I said it, I believed it. I wasn't just reaching into the air. Before saying such a thing, I had met with passengers, workers' stewards, management officials, transit experts. I honestly believed that within 100 days of diligent work I could get the system and the experience up to par. No one would be able to call Muni, as Herb Caen often did, "the Muniserable Railway."

Even though I had studied with and consulted the experts and the stakeholders, it wasn't until I took office that I discovered I was totally uninformed about the intimate problems associated with Muni.

Consider just the problem of customer complaints about operators. When I took office, I found there was a backlog of 800 complaints against drivers. These were statements of dissatisfaction so serious that the customer had taken the time to file a charge and ask for a review. I wanted to know why these charges were not being acted upon. It seemed a fairly simple matter to do so. So how come 800 of them were backed up?

Well, it wasn't lassitude or indolence on the part of the complaint office. The rules said that Muni could not complete a review of a complaint unless the operator involved had been present at the hearing. Yet at the same time, there was a rule governing operators' behavior that, as incredible as it may seem, allowed each operator to take a large number of days off from work each year without warning. You just didn't have to show up for work if you didn't feel like it.

You can guess what happened: whenever a hearing was scheduled, the operator could choose not to show up. He or she took the day off. The complainant would appear, but the charged operator would not. Do that two or three times and the complainant, who probably wasn't being paid by his employer to take time off, stopped showing up. The result: you could never get the two parties in the same room at the same time, so the matter of the operator's behavior was never adjudicated. The complaint went unresolved and the passenger had another reason for regarding Muni as the Muniserable.

I found a way. I recruited a prominent lawyer, Susan Mosk, to clean up and manage the complaint system. She brought in a full-time hearing officer - someone who did nothing but hold reviews on these complaints day in and day out. Then I got the television studies department at my alma mater, San Francisco State University, to provide students to videotape the testimony. The complainant could come in only once, testify on video and leave. The customer didn't have to keep coming back. And after awhile a recalcitrant operator who was ducking the hearings through his right to take a certain number of unscheduled days off would run out of days off to take. Eventually the operator would have to show up. The new system worked just fine. Through taped hearings going on full-time we soon cut the backlog down to nil. And we terminated abusive operators.

As a mayor you find yourself devoting enormous amounts of energy trying to figure out ingenious little solutions to problems like this. You've got to think creatively about problems, little and big. It helps to have a lot of experience in the real world. My years as a lawyer came in handy with many situations, including problems at Muni. We had a problem once when a Muni operator, off duty but in uniform, was riding a bus. This operator assaulted and beat a passenger because the passenger was gay. The operator was charged with a crime.

I told my executive director at Muni, Emilio Cruz, to remove the operator, to fire him. But the union, called upon to represent the operator in the termination matter, imposed the idea that the question of termination should not be acted upon until the criminal case was resolved. Frustrating and wrong to my mind, but fair is fair.

Several months later, after the criminal case wound its way through the courts, the operator was sent to jail. So we started removal proceedings.

This time the operator and the union objected again. They said the removal proceedings now were untimely because it had been so long since the incident occurred and that witnesses' memories were fading or gone, and that there were judicial issues. To me this was absolute pettifoggery in the service of a bad apple. This guy should not be a Muni employee. That was it.

One day, while I was in the middle of something else, the answer hit me. I called Muni director Cruz on my cell phone and said, "Look at the rules. Do the contract rules permit you to be absent from your Muni job while serving time in prison?" He said they do not. I told Cruz to issue an order to the operator telling him to be at work the next day. Of course, he didn't show up. We filed AWOL charges against him and removed this bad apple that way. This time he was gone without a whimper.

How to remove an operator, how to handle complaints - these are the sorts of intimate problems you don't know about when you're a first- time candidate. You think you know - there are the rules right there - but what you don't know is the gaming of the rules. Mastering them is just part of your job. It's not an achievement; it's just your job.

Achievement comes when you can get all the stakeholders together who are part of a big problem and work out a plan. You can't just broker a compromise either; you have to get people together in the service of a vision, the right plan. When it came to Muni's big problems - essentially figuring out what its place in the city should be and getting it there - we had to deal with a score of warring and interconnected parties representing different interests. There were the union contracts to consider, the limitations imposed by the civil service system, the demands of the very active bicycle coalition advocacy, the anti-automobile club, the advocates of free public transit, the problems of aging infrastructure and rolling stock. You couldn't get those together in 100 days.

Eventually, though, we did a lot to improve Muni. We opened new rail lines. We obtained the money and authorization to start a new subway line through Chinatown, whose residents use Muni in unbelievably large numbers. We got new rolling stock. And we improved the riders' experience. It didn't get done in 100 days. It took two terms. And some of these big projects, such as the Chinatown subway, won't be completed for 15 years. Muni was better when I left than when I arrived. It's still very important to me. Muni, when it works, is a great system. No matter where you live or work in San Francisco, you're almost never more than two blocks from a bus stop. I ride it often.

There were other operations, some quite unexpected, that required vast amounts of ingenuity and thought. One of my crowning glories was the restoration of a public building. It faced the same kind of political problems homelessness did. But buildings at least in San Francisco are more flexible than people. That's how this whole thing started - with a building being too flexible in an earthquake. And that's the next chapter in my book: the restoration of City Hall.