Uber noticed an interesting thing lately: customers were opening the app late at night and entering a nearby train station as a destination to see if they could game out how long it would take them to get there in the morning. It sounds stressful, so the company’s product team got together and designed a new feature to automate much of this planning.

The result is “Make My Train,” which Uber rolls out today to two of the largest commuter rail systems in the country: the Long Island Rail Road (LIRR) in New York and Caltrain in the San Francisco Bay Area.

It’s the latest example of Uber trying to play nice with public transportation

It’s the latest example of Uber trying to play nice with public transportation after years of directly competing with and poaching riders from subways, trains, and buses. Declining bus and subway ridership has been pegged to the rise of app-based ride-hailing in dozens of cities across the US. And Uber is hoping that by giving transit equal footing in its app it can blunt that criticism.

Make My Train works like this: when riders enter a train station as their destination, they will automatically see train schedules at that station and be prompted to select the train they want to make based on Uber’s real-time transit data. Riders then choose when they’d like to arrive at the station, and Uber’s algorithm spits out a suggested time to schedule their ride.

In some ways, this could be seen as an extension of Uber’s efforts to get cities, towns, and transit agencies to subsidize cheaper rides for commuters. Uber went to towns like Summit, New Jersey, 30 miles from Manhattan, and pitched them on subsidizing ride-hail trips rather than spending public money on new parking lots. The program has since expanded to dozens of cities and towns across the country. Recently, the Metropolitan Transportation Authority in New York put out a request for proposals on how to better connect riders outside Manhattan to the subway late at night. Uber is sure to respond.

Transportation experts see Uber as a crucial piece in solving the so-called “last mile” challenge. Using ride-hailing to connect commuters to transit “would not only improve first- and last-mile portions of trips but would also allow towns to redevelop parking lots near commuter train stations,” says Tom Wright, president and CEO of Regional Plan Association, in a statement provided by Uber.

Make My Train is just the latest piece of the rapidly evolving Uber Transit project. Last year, Uber announced it would begin selling train and bus tickets through its app for customers in Denver, Colorado — the first step in the ride-hailing giant’s high-stakes quest to become the de facto smartphone app for all modes of transportation. Since then, the company has integrated public transportation schedules and directions into its app for over a dozen other cities. Less than a year later, Uber says that “over 2 million riders” have tried Uber Transit.