When Marissa Mayer took over as Yahoo! chief executive last July, she confronted a Silicon Valley campus that was very different from the one she had left at Google.
Parking lots and entire floors of cubicles were nearly empty as some employees were working as little as possible and leaving early.
Then there were the 200 or so people who had work-at-home arrangements. Although they collected Yahoo! pay cheques, some did little work for the company and a few had even begun start-ups on the side.
These were among the factors that led Mayer to announce last week she was abolishing the work-from-home policy, saying that to create a culture of innovation and collaboration, employees had to report to work.
The announcement sparked a national debate over workplace flexibility, and at Yahoo! inspired much water-cooler conversation.
But employees say Mayer made the decision not as a referendum on working remotely but to resolve problems particular to Yahoo! They painted a picture of a company where employees were aimless and morale low and where a bloated bureaucracy had taken Yahoo! out of competition with its more nimble rivals. "In the tech world it was such a bummer to say you worked for Yahoo!," said a former senior employee. The employee added: "I've heard she wants to make Yahoo! young and cool."
Restoring Yahoo!'s cool - from revitalising products to reversing deteriorating morale and culture - is hard to do if people are not there.
Yahoo! reflected that view in its only statement on the work-at-home change: "This isn't a broad industry view on working from home. This is about what is right for Yahoo! right now."
Inside Yahoo! there has been mixed reaction to the policy change. Some employees said they were able to be highly productive working remotely and it helped them concentrate on work instead of the chaos inside Yahoo!
Brandon Holley, former editor of Shine, the Yahoo! women's site, said she built the site and signed on big-name advertisers while she and most of her team worked from homes across the US.
"It grew very rapidly," said Holley, who is now editor of Lucky, Conde Nast's shopping magazine. "A lot of that had to do with the lack of distraction in a very distracted company."
The change to the work-at-home policy initially angered employees who had such arrangements and worried others who occasionally stayed home to care for a sick child or receive a delivery. Reports that Mayer built a nursery for her young son next to her office made parents working at Yahoo! even angrier.
This week, the policy continued to be the topic of much discussion as people wondered aloud whether they would lose that flexibility. But for the most part, those concerns have been alleviated by managers who assured them the real target was the 200 or so employees who worked from home full time.
One manager said he told his employees, "Be here when you can. Use your best judgment. But if you have to stay home for the cable guy or because your kid is sick, do it."
Many of the problems at Yahoo! are visible to people outside the company. It missed the two biggest trends on the internet - social networking and mobile. Its home page and email services had become relics used by people who never bothered to change their habits. It ceded its crown as the biggest seller of display ads to Facebook and Google. Its stock price was falling.
Inside the company, there were deeper cultural issues. For Mayer's ambitious plans to turn around the company to work, she believed Yahoo! needed "all hands on deck".
Jackie Reses, director of human resources at Yahoo! and the author of the new policy, is an extreme example of this philosophy. She commutes to Yahoo! in California from New York, where she lives with her children.
"Morale was terrible because the company was thought to be dying," said a former Yahoo! manager. "When you have a workforce that is not terribly motivated, it built bad habits over years."
Mayer has introduced free food in the cafeterias, swapped employees' BlackBerrys for iPhones and Android phones and started a Friday all-employee meeting where executives take questions.
A recent internal survey found that 95 per cent of employees were optimistic about the company's future, a 32 per cent rise from the previous survey.
Resumes have begun arriving from employees at competitors, which rarely happened in the past.
Since Mayer made food free, there are now crowds in the cafeterias, lingering to talk about new ideas - exactly what she wants to encourage by requiring people to work in the office.