LONDON (WASHINGTON POST) - It all goes back to the countless hours Huzaifah Khaled spent on trains and in train stations, shuttling back and forth between his home in Nottingham, England, and classes at the University of Cambridge, some 90 miles (145km) away.
"In the UK, train stations are almost magnets for homeless people," Khaled said. "When I'd be waiting for trains, walking to and from the train station . . . I came into contact with a lot of them."
He talked with them, bought them coffee, and over time, developed relationships with them.
"I essentially developed a very deep understanding of their needs," said Khaled, who recently got his PhD in law.
It hit him that, for the homeless, even basic necessities are hard to access, and the limited hours for drop-in services at day shelters meant people had to schedule their days around visits to the shelter, making it hard to hold a stable job or see family regularly.
"I realized that there had to be a more effective way of getting at least the bare necessities to them," he said.
That's how he hit on the idea of a vending machine for the homeless: a 24/7 pit stop where people can access free food, clothing and other basic supplies.
The first vending machine launched this month in a shopping center in Nottingham, stocked full of supplies like water, fresh fruit, energy bars, chips and sandwiches, as well as socks, toothpaste, toothbrushes and even books.
The machine was installed by Action Hunger, a charity directed by Khaled.
The initiative has been close to two years in the making.
Back in early 2016, he had toyed with the idea of installing stocked fridges in cities across the UK. But fridges posed challenges for keeping track of supplies, so he switched gears and focused his attention on vending machines instead.
He devoted weekends and evenings to the project, all the while working toward his PhD.
"I speculatively approached over 50 manufacturers across England and Europe - most ignored my proposal, a few politely declined, and just before I was about to give up and try to raise funds to buy a machine instead, (N&W Global Vending) responded to my letter and invited me to pitch the idea to them," he said. "They came on board almost immediately afterwards."
N&W Global Vending, one of the world's largest vending companies, gave Khaled a 10,000-pound (S$18,000) machine for free. Meanwhile, Khaled reached out to the Friary, a day centre serving the homeless in the Nottingham area.
Now, as a partner organisation to Action Hunger, the Friary gives out keycards to its patrons, which are programmed to permit up to three items being dispensed per day. Users have to show up at the Friary once a week to continue receiving access to the keycards.
The idea is users do not become dependent on the machines, and are working toward a long-term plan for getting off the streets, Khaled explained.
He wants Action Hunger's low-cost vending machines, which are restocked daily by volunteers, to complement other existing services, and believes continued engagement with local support services is key to ending the cycle of homelessness.
Khaled hopes to expand quickly across the country, as well as across Europe and the United States.
A machine will be installed in New York City in February, followed by San Francisco, Seattle and Los Angeles.
Action Hunger has partnered up with Rescuing Leftover Cuisine, a food rescue nonprofit based in New York City, and is also in talks with Tyson Foods.
Over the next month, Khaled and his team will monitor which products in the machine are in highest demand, and which aren't as highly sought after.
In the longer term, they want to crunch data from the keycards to figure out whether giving someone access to free basic necessities contributes to helping them get off the street.
"Homelessness has become so accepted in our society that we often don't even look at these people," Khaled said.
He hopes Action Hunger's vending machines will represent a step toward a sustainable, long-term solution to homelessness. Even still, he wishes homelessness had never become such a seemingly intractable issue in the first place.
"In an ideal world, I would never have needed to start this charity," he said. "I would love nothing more than to shutter this charity next week."