To get street children in the western Indian city of Thane into school, civic officials initially forced their parents to send them to regular state schools.
The kids showed up late or not at all, and dropped out quickly.
So the officials decided on "signal schools", or small schools close to where the kids lived - on the street, near a traffic signal.
Partnering a non-profit group, they opened the first such school in June last year, in a remodelled shipping container under a flyover at one of the busiest traffic signals in Thane, just outside Mumbai.
This time, the kids stayed.
ADAPTING THE SYSTEM
You can't put these kids in a regular school and expect them to adjust. The school has to adapt to their lives. But just because they are on the streets, it doesn't mean they can't get an education. If these kids don't go to school, we have to take the school to them.
MR BHATU SAWANT, head of non-profit group Samarth Bharat Vyaspith, on why solutions have to be provided that fit the children's needs and lifestyles.
"It was a Herculean task to get the parents to send their kids to school - for them, it meant the loss of a pair of hands to earn extra money," said deputy commissioner Manish Joshi at the Thane municipal corporation.
"But they came around, and the community has also really embraced the programme. For a city with a space crunch and a migrant population on the streets, this is the best solution."
There is no official data on the number of street children in India - some charities put the figure at about a million. Most accompany their families as they migrate from rural areas to the cities in search of better prospects.
Mumbai, India's financial hub, has long been a magnet for migrants. There are more than 37,000 street children in the city, according to a 2013 study by charity ActionAid and the Tata Institute of Social Sciences.
Unable to afford even the cheapest housing, migrants often spill into nearby cities, including Thane, where they end up on the pavements and under flyovers, doing odd jobs, selling trinkets and begging at traffic signals to make ends meet.
India's landmark Right to Education Act (2009), which guarantees free education up to the age of 14, spurred government officials and charities into getting street children to school.
But their lack of a permanent residence and their lifestyles are a challenge, said Mr Bhatu Sawant, who heads Samarth Bharat Vyaspith, a non-profit organisation that runs the Signal School in Thane.
To set up the school, civic officials cleared a space under the flyover and fenced it off. They set up a small play area at one end with a swing set and a slide, and placed a guard at the gate.
The 9m by 3m container is painted in bright colours, and fitted with fans and lights. The classroom can accommodate about 35 children, and there is also a teacher's room, and shelves against the walls.
Since the kids help their parents sell trinkets and flowers during rush hour in the morning and evening, the school operates from about 10.30am to 5.30pm.
The staff spent the initial months teaching the kids about the importance of cleanliness and grooming, and to not fight over food or hold out their palms as they were taught to by their parents when they were sent to beg.
"You can't put these kids in a regular school and expect them to adjust. The school has to adapt to their lives," said Mr Sawant.
"But just because they are on the streets, it doesn't mean they can't get an education. If these kids don't go to school, we have to take the school to them," he said.
For the 27 kids in the Signal School, there is a book library and a toy library, and a wash area so they can bathe every day. There are lockers to keep their uniforms and books in, so they do not get damaged or stolen on the street.
A doctor comes to provide regular check-ups, and a barber gives the boys a haircut every month. The kids' nails are cut.
At the school, the doors and windows muffle the sounds of the traffic outside. Inside, the children sit on the floor cross-legged in groups, with a teacher, going over their mathematics, English and writing exercises.
Outside, on a mat, younger children sit in a circle with another teacher, listening to a story.
"Initially, it was very hard - they were not used to sitting in one place for so long, and they would fight or curse, or just go to sleep," said Ms Arti Param, who trains the four full-time teachers and a handful of volunteer teachers.
"We also had to teach their parents the importance of sending them to school, so they don't have to live on the street like their parents," she said.
India's literacy rate rose to 73 per cent in 2011, up from 65 per cent a decade earlier, and enrolment rates in schools have climbed. But at least six million children aged six to 13 are still outside the school system, according to a 2014 survey.
Mr Devendra Fadnavis, who is chief minister of Maharashtra state, of which Mumbai is the capital, said last month that the state would try to replicate the Signal School for street children elsewhere.
In Thane, Mr Sawant has asked civic officials for two more remodelled containers for a preschool and a high school. He also plans to bring children at other traffic signals on a school bus starting from June.
But there are bigger challenges, he said. "In the eyes of the state, they are still encroachers on the street, even if they have lived here for 20-25 years," he said.
"And if the parents can't make ends meet here, they will move elsewhere, and the children's education will become the casualty again."
The municipal corporation is considering skills training for the parents, and might help them find jobs and homes, said deputy commissioner Joshi. But in a city of high rents and little affordable housing, this is a challenge, he said.
"This school has been such a success - it's drawing more migrants who want this opportunity for their children," he said. "The real challenge is addressing migration and homelessness."
THOMSON REUTERS FOUNDATION