The Chicago Flag has three white stripes, two blue stripes, and four stars, representing the physical and civic foundations of the city: Chicago's north, west, and south sides; the river, canal, and lake; and Fort Dearborn, the Chicago Fire, the World's Fair, and the Century of Progress Exposition. Periodically the city considers adding to it, whether for the city's role in the nuclear era or the 2016 Olympics.

We think of the Chicago Fire as the element that shaped the city. But if the flag is missing anything, one of the fundamental elements that gave us the city we have today, it's probably shit. The city took form around it, and its most extraordinary engineering feats—still going, still not entirely working—were built to deal with it.

The city was literally shaped by excrement. Its biggest single period of growth, the growth that turned Chicago into the Second City by population, came in the late 1800s, when the city's sewer and sanitary systems were the envy of what were then suburbs. Lake View Township (the whole of the northeast side from North Avenue up to Rogers Park), Hyde Park Township (the south side between Pershing, State, and 138th), Lake Township (the southwest side bordered by Pershing, State, 87th, and Cicero) all latched on to the city when sophisticated sanitary systems were beyond the reach of booming townships, which were tightly restricted by the state's limits on local debt.

A larger jurisdiction, the result of annexation, was expected to reduce the cost of providing existing services and provide tax revenues to pay for additional ones. Many suburbs were unable to provide all the services their residents demanded. There were two common problems. First, many suburbs were unable to borrow money for improvements because they were already at their debt limit (typically 5 percent of their assessed valuation). Second, to be cost-effective, the new technologies required populations much larger than most suburbs were likely to have.

The city had begun 40 years before when it brought Boston's city engineer, Ellis Chesbrough, to build a sewer system. In March 1849, the year after the Illinois and Michigan Canal opened, the Galena and Chicago Union Railroad began, and Chicago got its first telegraph line—when it was born as an American metropolis—the city was flooded after a warmup and three days of rain caused the ice on the river to break. A "monumental ice jam" on the Des Plaines River created a giant ice dam; when it broke, it sent a wall of water and ice through the city, as Harold Platt writes in Shock Cities:

By now the entire population was drawn to the riverfront by the terrible commotion. "The cries and shouts of the people," a reporter wrote, "the crash of the timber, the toppling over of vessel masts, the terror-stricken crowds of people assembled in the adjoining streets, were sights and sounds never to be forgotten by those who witnessed them"…. After demolishing the final bridge across Clark Street with a tremendous boom, the floating mass of ice and debris became dangerously snarled at the elbow in the Main Branch at State Street.

A few weeks later cholera broke out in the city, killing 678 people that year. In 1854, it killed 1,549 people in a city that had only 30,000 in 1850, and 112,000 in 1860 (the Tribune reported the population at 60,000 that year). Chicago, Platt writes, was "the unhealthiest place in the United States." The Tribune editors blamed the foreigners:

We may also refer to the fact that the immigration of the present year is vastly larger than during any previous year since 1839 [not entirely legible], and that a large majority of the deaths are confined to the foreign population passing through or permanently stopping here. And when their habits of living are considered—how they dissipate with poisonous liquors and slops, and eat every manner of green and decaying vegetables, in quantities that no native could stand without injury,—the wonder is, not how so many die but how they live.

Independent of the Cholera Morbus, and the usual summer complaints, we can assure the public that our city is enjoying good health.

But even those who escaped the morbus were hardly enjoying the city, trudging around knee-deep in mud and waste. So the city raised itself out of the muck by an average of four to five feet, lifting buildings on massive jacks, (here and there in the city you can still find houses below street grade), so that Ellis Chesbrough could build his sewer system.

Chesbrough's system shot the city's waste out into the lake, turning the river into "a villanous compound of decomposed animal and vegetable matter, titurated with sufficient water to give it a semi-fluid consistency," as the Tribune described it. While Chesbrough's sewer cleaned up the city, it did so by fouling the river and the lake. So Chesbrough went farther out into the lake for fresh water, building the city's first water crib 600 feet out into Lake Michigan.

His solution was two shafts, one in the lake and one in the city, connected by two miles of tunnel. One is the crib; the other the Water Tower. Almost three years of round-the-clock work were required to build two miles of tunnel out into the lake. In 1867, Chesbrough took Chicago reporters on a rowboat tour of the tunnel, historian Carl Smith writes in his new City Water, City Life:

Under Chesbrough's direction, these anxious sailors directed their craft by pushing agains the tunnel's interior walls with their hands. Though the water was "clear as crystal, and sweet to the taste," their trepidation understandably increased as their lamps dimmed and then died. They began to fear that they would perish along with Chesbrough, who remained inexplicably unperturbed. They struck up "The Star-Spangled Banner" to muster their courage.

Chesbrough's design survived the fire. The Water Tower became a symbol of the city's resilience and rebirth, but its real lure was its expanding sewer and water systems, which attracted underfunded suburbs; once suburbs like Evanston and Oak Park grew able to build their own, the city's physical growth came to a halt.

But his system could only take so much shit. The river turned into a fetid ditch, and his miraculous tunnel-and-crib system didn't actually work to keep the city's water clean; a growing city evacuating itself in the direction of its fresh water supply meant that the tunnel, long as it was, wasn't nearly long enough.

So we reversed the river, building the the paradoxically named Sanitary and Ship Canal to send (literal and figurative) crap towards the Mississippi and out to the Gulf of Mexico. This time, it took eight years to build the 28-mile conduit; here's a good visualization. When it was completed, in 1900, the New York Times congratulated us: "The Water in the Chicago River Now Resembles Liquid."

New Yorkers, man. Then again, St. Louis filed a lawsuit against us, underappreciative of the fact that our engineering genius sent the whole of the city's waste through their front yard. They lost, forcing them to build a filtration plant. It's all a matter of who you're downstream from, or who you can engineer to be downstream from you.

At this point, Chicago had raised the entire city, tunneled two miles under it and out into the lake, and reversed the Chicago River, three of the greatest engineering feats of mankind, all to keep the city afloat, or the opposite of afloat. And it grew—more annexation, more people, more industry, and more shit. Which these heroic feats could not handle. So we built more channels, the North Shore and the Cal-Sag.

That didn't work, either.

Within the first ten years of operation it was clear that the district's works were not capable of handling the growing volume of Chicago's domestic and industrial wastes. In the 1910s the district began to construct sewage treatment plants to supplement the channel system. The decade of the 1920s saw the start of construction of the major treatment works that are the foundation of the city's current wastewater strategy. The Calumet sewage treatment works were placed in operation in 1922, followed by the North Side works (1928), the West Side works (1931), and the Southwest works (1939). A suit against the district was resolved in the U.S. Supreme Court in 1930 and resulted in a reduction of the district's diversion of water to reverse the river. This effectively reversed the district's approach; sewage treatment plants were forced supplemented by the channel system. 

Chicago was using Lake Michigan as a giant toilet tank, flushing 8,500 cubic feet per second from the great lake down towards the Gulf. The states of Wisconsin, Ohio, Michigan, and New York sued Illinois for draining the lake. The Court's opinion, written by Chief Justice Holmes, gave Chicago eight years to complete its treatment systems and reduce its use of lakewater to 1,500 cfs: "the restoration of the just rights of the complainants was made gradual rather than immediate in order to avoid so far as might be the possible pestilence and ruin with which the defendants have done much to confront themselves."

After the West Side works and the Southwest works were completed, they were joined into the Stickney Water Reclamation Plant, "the biggest wastewater treatment plant on earth":

The Stickney Water Reclamation Plant is located on 570 acres of Cicero, Il, just southwest of Chicago. That's big enough to warrant having its own railway—which it does. Processing upwards of 1.2 billion gallons per day (up from 787 million gallons/day in 2008), it serves 2.38 million people over 260 square miles including central Chicago and 43 suburban communities.

By the 1940s, Chicago had raised the city; tunneled under the lake; reversed the river; and built the largest sewage treatment plan in the world. And yet its combined sewer system was constantly overflowing, in 400 places over 375 square miles, running afoul of federal water quality standards.

So the city began another unprecedented engineering project: Deep Tunnel, a sewer for its sewers. The Water Tower tunnel was two miles; the Sanitary and Ship Canal, 28 miles. Deep Tunnel, when completed, will be 109.4 miles of tunnels processing 17.5 billion gallons a day—you may have noticed today that its current capacity, 2.3 billion gallons, still isn't enough—at a cost of some $4 billion and 54 years of work, assuming that it's completed by the legally required limit of 2029. That's what's going on underneath your feet today, when it isn't lapping at your ankles.

Deep Tunnel is one of two final pieces, if history allows us to make that judgement at this point. In between now and then, the MWRD will begin disinfecting its wastewater, if begrudgingly:

The fact that he’s willing to talk about these ideas at all represents a significant step forward for the MWRD. The agency has long been seen as averse to any form of outside interference. (It resisted disinfection of its outgoing treated wastewater for decades, for example, with one member arguing that disinfecting water that reentered the river would only encourage people to swim, and lead to more drownings.)

The end goal is a swimmable Chicago River, with a riverwalk as a city centerpiece and mayoral legacy, having finally built a manmade river of filth far beneath our feet, and finally out of the way after some 150 years.

But it could go farther than that, as Jeanne Gang told Chicago. Beginning at the notorious Bubbly Creek, Gang envisions a barrier that would not only reverse the river, but over a century of engineering marvels:

Next you would install this barrier, hydrological separation, dam—whatever you want to call it—basically reestablishing the divide between the Mississippi River watershed and the Great Lakes. It’s also, suddenly, a connection between Bridgeport and Pilsen. The whole book is looking at the barrier as a catalyst to reimagining [this part of the city].

The next step is to take out the canal—which is a concrete basin—and remediate the area so it can start to operate like a wetland. Use nature as technology. The wetlands will increase the amount of waterfront, increase the amount of green space, and increase property values on either side of the river. Then start to invest in more water treatment. Instead of pumping sewage and the overflow into Stickney, you could just treat it here. We need to expand our wastewater treatment. Use biodigesters to clean the water basically and return it to the wetlands for the last polishing.

Now we’d move the dam or build another dam. Instead of flushing water down to the Gulf of Mexico, we start reclaiming it. This is when you reverse the flow of the Chicago River, finally. Suddenly you’re catching the billions of gallons of fresh water a day that we drain from Lake Michigan and bringing it back to the lake.

In that end would be the city's beginning, turning the engineering back on itself, and after seven generations, learning enough to be able to put everything back in its place.