There’s no more effective method of moving millions of New Yorkers around the city on a daily basis than the NYC subway. Even though it may not always run smoothly, it’s still the best way to get from Riverdale to Rockaway and everywhere in between. A look at the evolution of our mass transit system reveals an interesting journey all it’s own.

The origins of mass transit in NYC date all the way back to 1827, when a 12 seat stagecoach called “Accommodation” ran a short route along Broadway from Battery Park to Bleecker Street. Within a few years, the New York and Harlem Railroad had taken it a step further, laying down track for horse-drawn carts that covered 27 routes in Manhattan along Third, Fourth, Sixth and Eighth Avenues.

Of course, mass transit wasn’t the subway until it went underground. The first below-surface trains in NYC were actually part of a short-lived pneumatic system built in 1870, with trains pushed along a 312-foot tunnel by fan! Of course, this wasn’t feasible for a city-spanning operation, and it wasn’t until the opening of Interborough Rapid Transit (IRT) in 1904 that New York had proper subway trains suitable for true citywide travel.

IRT service expanded quickly, covering all boroughs but Staten Island within a decade, but its tracks didn’t quite reach every corner of the city. Competing systems to fill those gaps popped up in the years to follow: the privately-owned Brooklyn Rapid Transit (later known as Brooklyn-Manhattan Transit or the BMT) in 1923, and the city-run Independent Rapid Transit Railroad (IND) in 1932.

These systems, while connecting with each other at some stations, were not folded into one until 1953 under the new Transit Authority, later renamed the Metropolitan Transit Authority or MTA. MTA now stands as a catchall term for every subway line, but talk to some old New Yorkers and they’ll probably still point you towards the IRT or BMT when offering up directions. Some old habits die hard.

Two years after the merger, the once ubiquitous above-ground lines in Manhattan were gone for good, though extensive elevated tracks still cover parts of the Bronx, Queens, and Brooklyn. In fact, though the subway is probably best known as an underground phenomenon, a full 40% of the system runs on elevated tracks, reaching a height of up to 88 feet at the Smith-9th Street F and G station.

By the 1970s and 80s the system was well established but aging fast. Concerns about safety, financial instability, and a citywide population decline caused ridership to hit historic lows, and observers wondered what could be done. Graffiti covered nearly every car in the system, and outside of rush hour the subway was considered to be too dangerous and decrepit for even the typical New Yorker.

It was clear that the subway was in a crisis, but in true NYC fashion it was able to bounce back after a massive infusion of capital fixed some (but not all) of the subterranean system’s issues. Today, the subway and the city as a whole are as safe as they’ve ever been, but the MTA is still plagued by delays, overcrowding and heaps of unsatisfied riders. MTA leadership is still fumbling for an answer, and even Commissioner Joe Lhota has openly declared “it ain’t gonna be easy.” Even still, when New Yorkers need to get somewhere, more often than not the MTA will be going their way, even if the ride is slower than they might prefer.

Today’s subway system serves 472 stations over 665 miles of track on 26 different lines, a far more accommodating service than the horse-drawn carriages of centuries past. Tech advancements like WiFi and cellular service along with recently installed real-time arrival signs in every station mark our modern subway as a marvel for the 21st Century, with further improvements planned for modernizing and improving the system in the decades to come.

While it may be far from perfect, the NYC Subway has certainly come a long way. For the 1.7 billion riders swiping through the turnstiles every year, a look back shows there’s reason to be optimistic about the future.