SAN FRANCISCO -- Oakland renter Wanda Dunlap and San Francisco tenant Mathilde Agoustari were both displaced by last October's Loma Prieta earthquake. The buildings that they occupied on different sides of San Francisco Bay were both heavily damaged by the huge tremor.

The quake destroyed or damaged 24,526 homes or apartments and it took a heavy emotional toll on the lives of people like Dunlap and Agoustari. But a year later, Agoustari is back in her renovated apartment in the upscale Marina district and Dunlap is moving from homeless shelter to homeless shelter in downtown Oakland.

Both women got a temporary boost from the Federal Emergency Management Agency (FEMA) and the Red Cross, but Agoustari's building was quickly repaired and reopened for occupancy in two months, while the Hotel Woodrow where Dunlap lived still sits boarded up and languishes in the bureaucratic maze of earthquake recovery.

Immediately following the quake, Dunlap was moved into a new apartment, where her first and last month's rent were paid from disaster funds. But her rent was $431 a month, which fits the federal definition of affordable, but was too expensive for Dunlap's fixed-income budget. After falling behind in the rent payments, she was evicted and has been homeless for the last 10 months.

The experiences of Agoustari and Dunlap since that time show how uneven the earthquake recovery has been for those in need of housing.

While many of the single-family homes and market-rate apartment buildings have been repaired, the job of replacing and rebuilding the affordable housing has sputtered along, with thousands of units still vacant.

Bureaucratic delays, a shortage of funds and restrictive building codes shoulder some of the blame. But experts say these hurdles are a function of a larger institutional problem. The federal and state disaster agencies and volunteer groups such as the Red Cross were unprepared for a natural disaster in an urban setting, where affordable housing is scarce and where poverty is widespread. This environment presented complex problems with which disaster experts were unfamiliar.

"They just didn't understand the housing needs of the urban poor," said Na'ama Firestone of Berkeley Oakland Support Services, a nonprofit group that has been assisting people with earthquake recovery.

Though their personal tales of woe shouldn't be underestimated, most homeowners who suffered damages have already rebuilt or have plans underway to make the necessary improvements.

Homeowners have also been quicker to receive aid. The California Natural Disaster Assistance Program has approved financial relief to 120 homeowners, but only 14 rental applications have been approved.

Visible headway is being made to fix up the market-rate apartments that were damaged. About 450 Marina district rental units that were red-tagged as uninhabitable by San Francisco building inspectors are slowly being repaired. Another 600 units in buildings that received "limited-entry" yellow tags are almost fully occupied today. Only eight buildings in the Marina area were bulldozed and those properties are under construction or have plans being processed.

Construction began this past summer on the site of the Marina building on Jefferson Street that was engulfed in flames moments after the quake.

"In most areas of the Marina, life has been totally restored," said Tom Jones, special projects director for the San Francisco Office of Housing.

It's a different story in the single-room occupancy hotels and low-cost apartments in San Francisco's South of Market neighborhood and Oakland's downtown, where the earthquake recovery effort has stumbled.

No improvements have been made to the 300 single-room occupancy hotels in San Francisco that were damaged, and the 1,117 damaged single-room occupancy units in Oakland sit vacant, the victim of vandals and squatters.

"We have twice as many people fighting for half as many housing units," said Lee Collins Rink, coordinator for Oakland Housing Organizations, a coalition of nonprofit groups that is pressing for solutions to the boarded-up single-room occupancy hotels.

One example is the 98-unit Madison Park Apartments building, which is located next to a downtown Oakland mass transit hub. Rehabilitation on the historic structure had just been completed when the earthquake hit. Today, the low-rent apartment building is boarded up as government officials and community groups haggle over its fate.

Some of the vacant buildings in Oakland have been taken over by squatters who have illegally set up camp in the unsafe structures.

"When you have no other choice, it's one way to go," said Regina Falcon, who lost all of her possessions in a downtown building that was damaged by the quake. Since that time, she said she has been living in homeless shelters and has participated in a number of squatter protests in Oakland to "let people know that this situation isn't something that can be ignored for much longer."

Many of the damaged buildings have also been vandalized.

"The Hotel Woodrow may have had $100,000 worth of damage from the earthquake but it's got $500,000 more from vandalism," said University of California at Berkeley architecture professor Randolph Langenbach, who has been providing design assistance to the recovery effort in Oakland.

He blames a stubborn Oakland building department that didn't allow owners to make limited repairs and that didn't permit people to move back into the buildings.

"We should have kept these buildings alive to avoid the squalor conditions that you see today," Langenbach said.

The relief effort has no shortage of good intentions, benevolent charities, well-funded government programs and determined property owners.

Nonetheless, Jacqueline Wagner, who is a general partner in an investment group that owns the 108-room Hotel Touraine in Oakland, said, "My frustration with the bureaucratic process is overwhelming." She described one application for state assistance that is "five inches thick."

"The only way to get anything done is to telephone every two hours to make sure this or that department is following up on this or that application," she said. "On more than one occasion, I have threatened to turn the building over to the bank."

Wagner's first stumbling block was getting a building permit. After haggling with city officials for six months, she was finally granted a permit in April.

"Looking back, that may have been the easiest step," Wagner said.

More than $600 million in state and federal funding has been earmarked for earthquake recovery, but getting to those funds hasn't been easy, said Wagner, who faces a $2 million rehabilitation job. She and her partners persuaded the Small Business Administration to give her a $500,000 loan, but it's contingent on the remainder of the funding becoming available.

Wagner hopes to receive money from FEMA, but that depends on a controversial lawsuit against the federal agency being settled.

Last January, legal aid groups in Oakland and San Francisco filed a lawsuit on behalf of single-room occupancy residents to ensure that they received benefits from FEMA. A point of disagreement is a federal requirement that people occupy dwelling units for 30 days before they are eligible for aid. Legal Aid attorneys successfully argued that transient hotels often don't permit people to stay for longer than four weeks but that these hotels still offer a legitimate source of housing for thousands of low-income residents.

Legal aid groups also wanted FEMA to fund the repair and replacement of single-room occupancy hotels damaged in the quake.

"The single-occupancy hotels presented a real dilemma," said Tommie Hamner, chief of disaster assistance programs in the San Francisco office of FEMA. "A misconception is that we are going to replace all of that housing."

Government officials also complain that housing advocacy groups had expectations to solve social problems that existed prior to the quake and that go beyond the emergency relief effort.

"We were set up to respond to emergencies, not to build affordable housing," Hamner declared.

Nevertheless, a tentative settlement was reached last week that is expected to provide as much as $500 million for single-room occupancy reconstruction.

Under the agreement, FEMA will be required to fund nonprofit groups that will work with property owners to improve their buildings and in some cases purchase them from private parties.

Some nonprofit groups have already made progress and are awaiting the federal aid. In Berkeley, the University Avenue housing organization has successfully negotiated the sale of the 78-unit U.C. Hotel. With state, federal and local aid, the University Avenue group plans to begin construction as soon as it obtains FEMA funds and a loan from the state disaster program.

Once the project is complete, which could take up to three years, another challenge begins. "We have to track down the people who were displaced," said Susan Felix, executive director of University Avenue Housing Inc. "We can't ever forget what this massive recovery effort is all about."