China has the fastest-ageing population in human history but the state provides very little support for elderly people. Ageing parents have traditionally been looked after by their children - but in today's China that is not always the case.
China has a lot of orphanages for children. But the Ji Xiang temple has an entirely different purpose - it's an orphanage for the elderly.
High in the mountains of China's southern Fujian province, the temple has all of the things you might expect to see in a Buddhist sanctuary. A giant Buddha statue dominates the cavernous main building, filling it with a golden glow. Outside, a beautifully sculpted garden is dotted with small stone statues.
But look closely and other things reveal the temple's main function: handrails along the steps and rows of medication bottles in a cabinet in the hall.
Dozens of elderly people are living their final years here. Some are too poor to go elsewhere. Others have no children to care for them. But most have simply been abandoned by their families. In extremely poor communities, once they can no longer work, they're considered to be a burden.
"In this area, there's not much family loyalty," explains the temple's head nun, Neng Qing. "Old people are really suffering. In a neighbouring village, there was one old person who had eight children. Every morning, he went to each of the children's families but no-one even invited him in for breakfast. The village contacted us, but it was too late. He had already committed suicide."
At 81, Neng Qing still runs the whole operation, travelling into villages to rescue elderly people who are dying from lack of care.
"It's heartbreaking when we go to pick up these people from their homes because some of them have been sick for a long time. Sometimes, daughters-in-law make their husbands abandon their mothers because they've lost the ability to work. They're in such bad health that we have to carry them out on a stretcher, but then we nurse them back to health."
The temple runs on a strict schedule, starting at 4am every morning. All the residents are expected to rise in order to study Buddhist texts. An hour-long chanting ceremony follows before breakfast is served. The same pattern continues throughout the day: reading, chanting, eating, resting, until everyone sleeps shortly after dark.
"We all watch out for each other," Neng Qing says. "I used to wake up twice a night to change the heating pads under the bed covers for the residents, but now they help each other. The 80-year-olds help the 100-year-olds."
The entire place is so clean and orderly that it's easy to forget that many of the residents have escaped from a nightmare.
Two tiny sisters who share a room on the ground floor are a perfect example. Shi Yuping is 92 and Shi Guazi is 86. Both have white hair pinned neatly behind their ears. Guazi coddles her older sister, combing her hair and fixing the pins.
"No-one cared for me at home. My four sons wouldn't look after me there," she says. "My home isn't as good as this place. If it was good, I would have stayed."
When Shi Guazi arrived at the temple, she was painfully thin because her children had refused to feed her more than a single bowl of rice a day.
A year later, her older sister followed her, and for the last decade, they've lived together in the temple.
Many worry who will care for the rest of China's elderly, currently numbering 220 million. China has the fastest ageing population in human history, according to the World Bank. By 2050, more than 40% of the population will be over the age of 60.
Traditionally, every generation of a Chinese family lived under the same roof. But that system is facing serious challenges in modern, mobile China. Now, just 38% of people over the age of 60 live with their adult children, according to a major study by Chinese and American researchers released in 2013. Just over half of those living alone received financial support from their children.
Adult children often live close to their parents, but modern apartment blocks don't have room for many generations of a family to live together. In poorer families, children often migrate to other parts of the country for work, leaving elderly parents behind.
There is little support for elderly people when they reach the end of their lives. In a recent "quality of death" survey by the Economist Intelligence Unit assessing end-of-life care offered in 80 countries around the world, China came in the bottom 10, due to its lack of hospice facilities, unaffordable hospital care and lack of community support. In the same survey, the UK ranked number one.
In China's cities, the government is rushing to deal with the problem. In Fujian's Sanming City, a short drive from the temple, the government is rushing to address the needs of its booming elderly population. A new seniors' centre just opened its doors, putting free basic medical care and community services under one roof. Another 13 are slated to open nearby.
But even the local Communist Party Secretary admits the centres are "experiments".
"Only relying on the government for elderly care isn't enough," Su Yitai admits. "That's why we're trying out a new model that combines government, community and family support to try to build a new system that fits Chinese society."
And even greater challenges lie in the countryside, Su says. Poverty is a serious problem in the Chinese countryside - 65% of elderly people living in rural areas live below the poverty line, compared to just 11% in cities.
If a relatively wealthy city is struggling to provide services to a dense neighbourhood, how much harder will it be to extend care to elderly people dotted in tiny villages across China?
The Ji Xiang temple is one of the few places in China offering free end-of-life care. The residents appear to be profoundly grateful for the things they have received - thick cotton coats to keep them warm and heavy blankets for their beds.
At four o'clock every afternoon, the residents change into heavy brown robes for the last chanting ceremony of the day. As they wait for the ritual to begin inside the main temple, some of the women hug each other, admiring each other's robes.
Here, there is some comfort and community. In this small part of China, there is dignity in life and, eventually, in death.
Subscribe to the BBC News Magazine's email newsletter to get articles sent to your inbox.