The 10-Billion-Dollar Sham of Theranos

Some things in life are too good to be true. This was the case for Theranos, a health technology company that once tried claiming it could perform hundreds of tests with “unrivaled accuracy” on a drop of blood. Founded by then 19-year-old Stanford dropout Elizabeth Holmes in 2004, it raised more than 700 million USD, reaching a valuation of 10 billion USD. It all came crashing down in late 2015, when John Carreyrou of Wall Street Journal published a series of devastating revelations.

Its valuation after 11 years and adventuring the health of millions of people — how in the world did something like this unfold? To better understand matters, I picked up Bad Blood by Carreyrou, detailing the rise and fall of Theranos. Although I expected the worst reading it, I was still taken aback by the level of deception involved and Theranos’ organizational culture. I’d like to discuss these two topics in detail, drawing parallels between the story of Theranos and the world of software.

Deception at Theranos

Elizabeth Holmes
Elizabeth Holmes, the then-19-year-old Stanford dropout who founded Theranos

A recurring theme is how convincing Elizabeth Holmes was. She told lies one after another, and of growing size to cover previous lies. The list of victims included prominent ones: C-level executives of multibillion-dollar companies, billionaires, two former US Secretary of States and a US army general.

The common denominator was that they had little to no knowledge in the disciplines and fields that Theranos operated in. When we have to form opinions or make decisions in such scenarios, we put more weight on what’s superficial. Our bullshit detector malfunctions.

Holmes’ charisma, intelligence and unrelenting drive captivated many. “The way she trained her big blue eyes on you without blinking made you feel like the center of the world”, Carreyrou writes. She also spoke in a deep baritone, giving her voice a mesmerizing effect. In an environment dominated by men, she was perhaps taken more seriously as a result.

To gain credibility and bypass regulation, she was meticulous in cultivating relationships. She was also a great storyteller, using her uncle’s (whom she was not close to) premature death as a marketing and morale-boosting ploy. Like Bill Gates, Mark Zuckerberg and Steve Jobs, she dropped out of college to found a company.

The problem was that none of these things provided strong or direct validation of Theranos’ technology. Being on the cover of Forbes and Time, winning a Glamour award and having high-profile politicians raving about you is nice and all, but it doesn’t say much about your technology.

At the same time, people overlooked other indicators and the absence of them. Where were the peer reviews? Why had no venture capitalists experienced in health technology invested? Why was the board "better suited to decide if America should invade Iraq than vet a blood-testing company", as one anonymous source put it?

Deception in the World of Software

While deception is too strong of a word to use here, I’ve noticed certain things throughout my career. These things exist in part because of a lack of understanding about software.

Theranos Sales and Marketing Fluff
Sales and marketing fluff at its best

When purchasing software and services, the less a potential customer knows, the greater the role salespeople play. They tend to be charismatic, well-dressed and eloquent, with enough knowledge to be a level above the customer. They refer to home pages and show slide decks that are colorful and laden with buzzwords (eg. cloud, big data, predictive intelligence) and bold but vague claims (eg. “one tiny drop changes everything” in the case of Theranos). Out of time, quality and cost, these customers rate being on schedule and being on budget higher. This is because quality is much harder to evaluate.

What’s also interesting are certifications in software. In companies less knowledgeable about software, they can give you credibility. As they lack the means to gauge actual skill, it makes sense to resort to certifications. After all, confirming their existence is straightforward. On the flip side, companies with a strong engineering culture view them in negative light. The exception is when they sell software and services to the former, common in e-commerce. I recall a former workplace, where certifications and dubious awards adorned the walls by the reception.

On that note, it’s also comical in a way seeing how companies with predominantly software illiterate clients operate. They dress up junior developers as seniors, and can come up with all sorts of excuses when shit hits the fan (eg. blaming third-parties for their own shortcomings). I also have a suspicion that feigning ignorance is a strategy they sometimes use to reduce scope.

Organizational Culture of Theranos

Something which also stood out about Theranos was its organizational culture. It was such a long list of don’ts in regards to leadership and fostering a positive work environment, that I don’t even know where to start.

Apart from Holmes, second-in-command Ramesh "Sunny" Balwani played a large role in this. He was a software developer who struck gold before the dot com bubble burst. Despite the 20-year age gap, they were in a romantic relationship, something they kept secret. Sunny ruled by fear, and due to his background, saw employees as his minions.

Together, they ran Theranos like a cult. If you didn’t show “complete devotion”, “unmitigated loyalty” and believe in the “religion”, you ought to leave. In practice, this meant you had to work long hours including weekends. To ensure you were committed, Sunny performed fly-bys of the engineering department late in the evenings. He had security cameras set up, and monitored when you punched in and out of work as well as your email activity. Holmes and Sunny even tasked certain employees with eliciting gossip, spying on Facebook profiles and faking Glassdoor reviews.

If you expressed skepticism, raised concerns, or simply objected, you were labelled a naysayer, cynic and non-team player. Firings were constant and sometimes done in public to make an example of you. They were abrupt, in which case you had to contact former colleagues to help retrieve your belongings. When terminations weren’t silent, Holmes made it a point of controlling the narrative. On the way out, they coerced you to sign a nondisclosure agreement.

They micromanaged, from insisting on doing things a certain way (against the advice of domain experts) to having to approve all hirings. Holmes went out of her way to give information on a need-to-know basis, ensuring that only she had the whole picture. To facilitate this, departments were not cross-functional and siloed. Nepotism was also rampant: Sunny and Holmes’ younger brother, both with no background in neither medicine nor science, were the prime examples.

Theranos Sales and Marketing Fluff
Elizabeth Holmes with Bill Clinton and Jack Ma during the Clinton Global Initiative 2015 Annual Meeting

Organizational Culture in General

One observation I’ve made pertains to how the values and actions of people in managerial positions affect the rest of the company. While the effects may not be visible in the span of a couple months, long-term they become obvious. It’s not so strange after all. They make hiring decisions and decide who to promote, fire or marginalize. There is also a tendency that co-founders and higher-ups come from the same network. Those who don’t share the same values don’t last long, decline the offer, or don’t even consider joining to begin with.

In the case of Theranos, many employees eventually consisted of yes-men and those on H-1B visas who depended on their employment to stay in the US. It would also not be bold to assume that employees with integrity who were more talented and smarter had shorter tenures. They had more options, and caught whiff of the sham sooner.

When it comes to gauging employee performance, I’ve also found a tendency. Managers who do not understand the very things they are managing and lack self-awareness, resort to vain metrics. To Sunny and Holmes, working long shifts and weekends was important. As was agreeing with them — they saw themselves as geniuses, so anyone who agreed with their ideas was also smart. The world of software also has its own, such as lines of code, bugs found and features released. The reality is that performance, particularly for developers and most who worked at Theranos (I’d assume), is highly contextual. If you want to gauge it, you need humans who have expertise in those disciplines and understand the work environment.

Building a great product is hard today, as the big corporations have raised the bar. Thus, from the perspective of companies, creating an organizational culture that attracts and retains talent is paramount. From the perspective of employees, we have to factor in and vet people in managerial positions when deciding on companies to work for. It is them who will play a large role in dictating your future colleagues and the future of the company.

Closing Thoughts

There is much more to discuss, which I hope the upcoming movie about Theranos starring Jennifer Lawrence will spark. What were all the factors that enabled Theranos to rise so high and exist for so long, causing actual harm to citizens? What do we need to change to prevent something of the same magnitude from happening again? Sure, the power of greed and the fear of missing out played large roles. But how about the US legal system which allowed Theranos, through enlisting a top law firm, to intimidate, harass and silence skeptics? What role did media play and, by extension, the general public like myself?

I suspect Theranos was also an example of "bullshit asymmetry", in that domain experts understood from the get-go how ridiculous their purported technology was. As one put it, “I’d be less surprised if they told us they were time travelers who came back from the twenty-seventh century than if they told us they cracked that nut”. But few pointed out the emperor had no clothes. It would take too much effort for little to no gain, and you’d be called a Luddite, a corporate shill or a misogynist while attempting it. Worst of all, you’d most likely also be labelled as anti-science.

Last but not least, I hope the people who helped expose Theranos are not forgotten. They had to endure legal threats and private investigator surveillance, while risking their careers. Tyler Schultz, an employee whose grandfather was on the board of Theranos, paid a hefty price. Besides a damaged family relationship, he and his parents had to spend more than 400,000 dollars on legal battles against his grandfather and Theranos. We owe Tyler and the others a debt of gratitude for putting so much on the line, for the sake of doing what was right. It’s one thing to deceive when selling harmless software, but a line is crossed when you deceive and adventure lives in the process.

Extracting the World Map of Uncharted Waters 2

Over a year ago, I set out to remake a game called Uncharted Waters 2. This month I reached a milestone, having extracted the tilesets and tilemap of its world map. As no one has detailed this, I’d like to contribute.

Uncharted Waters 2 world map
The world map in Uncharted Waters 2

Much of my work is thanks to an old discussion on a Chinese forum, where a user called botx had outlined the general algorithm. My implementation, along with the relevant game files, are available on GitHub.

At a Glance

The game splits the world map into three parts. The first part contains Europe and Africa, the second part Asia and Australia, and in the third part you will find the Americas. Each part consists of 30 * 45 blocks. 12 * 12 large tiles form a block, where each large tile in turn consists of 2 * 2 regular tiles.

Both the regular and large tiles are tilesets. The regular tiles are 16 * 16 pixels in size, of which there with 128 variations. The large tiles are 256 permutations of four regular tiles, and 32 * 32 pixels in size.

In short, the approach is to extract these two tilesets first. Then, move onto the blocks and figure out their indices. Map each index to a large tile, which in turn maps to 2 * 2 regular tiles. Afterwards, perform some extra processing for, among others, coastal tiles.

The raw data comes from the game files WORLDMAP.000, WORLDMAP.001, WORLDMAP.002, DATA1.010, DATA1.011 and DATA1.018. To get them, you need to uncompress WORLDMAP.LZW and DATA1.LZW using a tool such as "LS11 Archiver".

Uncharted Waters 2 world map breakdown
A breakdown of the three parts of the world map, blocks, large tiles and regular tiles

Regular Tileset

Uncharted Waters 2 world map regular tileset

The first half of DATA1.011 (16384 bytes) contains the 128 regular tiles. Each tile is 16 * 16 pixels in size, where each pixel uses 4 bits.

To extract all pixels, read 1024 bits at a time. Form the first pixel by combining bit 0, 256, 512 and 768 (left-to-right offsets). The second pixel by 1, 257, 513 and 769, and so on. Map these 4-bit values to RGB colors, drawing each tile left-to-right, top-to-bottom. The mapping varies based on time of day in-game; refer to my implementation for details.

Example: Bit 255 is 1, 511 is 0, 767 is 1 and 1023 is 1. The 4-bit binary number is 1011, giving us the value 11. This maps to #007161 and, being the 256th pixel, defines the bottom right of a tile.

Looking at the resulting tileset, there are obvious placeholders. There are also tiles used for ports and villages. If you take a longer look, you will notice all the terrains and tiles that appear to be coasts. Their significance will become clear soon.

Large Tileset

Uncharted Waters 2 world map large tileset

DATA1.018 contains 256 large tiles that are 4 bytes each, giving a file size of 1024 bytes. The 4 bytes describe a permutation of 4 regular tiles, left-to-right, top-to-bottom.

Example: The 17th large tile consists of bytes 60, 61, 62 and 63, which have the values 116, 117, 118, 119. Mapping them to the regular tileset gives us the tiles that form how a port looks.

For the first 16 large tiles, however, the logic is different. Ignore DATA1.018 and express their index value in binary, where 0 maps to 0 (regular sea tile) and 1 to 65 (regular land tile).

Example: The 3rd large tile has an index value of 2, which is 0010 in binary. This gives us the values 0, 0, 65, 0, which is all sea except the bottom left tile.

Like regular tiles, there exists large tiles that are redundant and never used. Some of them even map to out of bounds regular tiles, for which I have replaced with transparent tiles.

Blocks

WORLDMAP.000, as well as the two other world map parts, contain 30 * 45 blocks. A block is 12 * 12, where each index maps to a large tileset. In contrast to extracting regular and large tilesets, blocks are less straightforward.

The game describes each block using a template, together with data about how it differs from it. In total, there are six templates. To start extracting blocks, do the following:

  • Skip the first 2700 bytes.
  • Read 8 bits. The value of the three rightmost bits map to a template. The leftmost bit is 1 if the block, in the rare event, matches the template. Otherwise, proceed reading further.
  • Read 144 bits, and take note of when and where 1s occur as they state deviations from the template.
  • For each 1 encountered in the previous step, read 1 byte and use its value to correct the template.
Uncharted Waters 2 block templates
A block is based on one of these six templates

Contrived example:

  • The first 8 bits are 00000101. The three rightmost bits are 101, which refers to template number 5. The leftmost bit is 0, meaning there are differences.
  • Reading the next 144 bits, we find that the 13th and 131st bit are 1s.
  • We continue to read 2 bytes, and find that the first byte has a value of 16 and the second byte 17.
  • The resulting 12 * 12 block is all sea except two large tiles: a port at (0, 1) and a village at (11, 10).

Each block takes up a varying number of bytes — some take just a byte, while others 1 + 18 + the number of 1s within the 144 bits.

Coastal Tiles

Uncharted Waters 2 world map coastal tiles
Replacing regular sea tiles, before and after

Having extracted all blocks, replace regular sea tiles that neighbor land to give coasts a less jagged look. To determine their replacements, iterate all regular sea tiles and do the following:

  • Form 8 bits by going counterclockwise through each adjacent tile. The first, leftmost bit comes from the top left tile. The obtained bit is 1 if the adjacent tile is land (non-water and non-coast), and 0 otherwise.
  • Using this 8-bit value, add 256 to it to get n. Read the nth byte of DATA1.010, of which its value replaces the regular sea tile.

Example:

  • Of a regular sea tile, all three adjacent tiles to the top are land while the rest are sea. This gives us the bits 10000011.
  • Adding 256 to the 8-bit value of 131, we get 387. As the 387th byte of DATA1.010 is 2, change the regular tile from 0 to 2.

Deserts and Other Terrain

Uncharted Waters 2 world map deserts and other terrain
Three sequences of before and after: filling deserts, updating polar regions, and updating temperate zones

Of the few deserts in the world map, blocks only contain data about their edges. To fill their bodies, iterate regular desert tiles (89) and replace the right and bottom tiles to also be 89 if they are land tiles (65). Iterate left-to-right, top-to-bottom, including the newly replaced tiles. Afterwards, replace all desert tiles which border non-desert.

Blocks for the most part only express a single, default terrain, where regular land tiles are 65. Based on specific rules, apply corrections to them and coastal tiles. For the polar regions, which are the first and last block rows, add 16 to cover them by ice. For the temperate zones, rows 1 to 13 and 31 to 43, add 8. These corrections are only applied to default terrain: some land south of the Straight of Magellan, while in the last block row, is not covered by ice.

This section contains few details as I have not understood how the game applies them. If one has gotten this far, however, defining the mapping rules for desert "coasts" should not be an ardous undertaking.

As a side note, I made changes to a handful regular tiles to correct what appears to be minor oversights.

Closing Thoughts

I found the approach Uncharted Waters 2 uses to compress data fascinating — utilizing two tilesets, storing blocks as template differences, and deriving coastal tiles and terrain. It’s funny how this contrasts what we can afford doing today, bundling entire web browsers with desktop applications.

Next up for my remake is making it possible to sail around the world. I foresee a couple of challenges:

  • How should the canvas be drawn? Its appearance changes often, as the color map varies with the in-game time. Drawing the entire map as a base, which I did for ports, is out of the question as this map is much larger.
  • Uncharted Waters 2 has AI fleets that sail around the world, and with a purpose. This means that coding their behavior will be needed. They need to be able to find their way to all ports, as well as hunt you down in the case of corsairs.
  • Investigation needs to be carried out to understand how the game simulates wind and ocean current. Are things like the Gulf Stream, westerlies and trade winds implemented in the game? Where and how do storms occur?

The Cruel yet Inspirational Sport of Boxing

Over the past two years, what’s surprised me about myself is that I’ve taken up an interest in the sport of boxing. The sport where two people put on gloves and get onto a 6 m square platform, enclosed by rope. As the bell sounds, over the course of 36 minutes, they start boxing each other with the ultimate goal of scoring a knockout. The smallest margin of error can change their lives, all the while millions of spectators are cheering them on.

Canelo vs. Golovkin
Canelo Álvarez and Gennady Golovkin, two of the best boxers in the world, when they clashed on September 16, 2017

While it doesn’t take long to realize the sheer brutality of boxing, I realized more things as I gained a better understanding of the sport. Here are three things I realized, while drawing certain parallels to society as a whole.

Cruelty Beyond the Actual Fights

Something which is plaguing boxing, and has been for decades, is systemic corruption.

If a fight goes the distance, the scorecards of three judges determine the victor. But judges score boxing, like figure skating and diving, in a subjective manner. Outside of obvious knockdowns, judges look for the boxer who best controls the action and acts as the aggressor. They also look for the boxer who lands the most clean and hard punches, and the boxer who is able to defend better. In other words, the scoring is in stark contrast to the black and white nature of tennis and golf.

Boxing also has a lack of regulation and oversight. There’s no central authority in the form of a national commission. The sport also lacks structure, as there are no tournaments, leagues or schedules (outside of amateur boxing).

In the midst of all chaos, the power brokers are the promoters. They set up the deals and arrange the fights. They can also be the ones responsible for the travel, lodging and food costs of the judges and the referee. Promoters can also have direct ties to the manager of a boxer, the very person whom should be representing the best interests of the boxer. In short, boxing has conflict of interest written all over it.

Roy Jones Jr. vs. Park Si-hun
Park Si-hun lifts the rightful winner Roy Jones Jr. into the air. Park retired from boxing after the Olympics, and Jones would go on to become one of the best boxers of his generation.

An infamous example of corruption in boxing, although this was amateur boxing, happened at the 1988 Summer Olympics in Seoul. In the finals, Roy Jones Jr. beat his opponent Park Si-hun in a one-sided affair. Yet, when the result was announced, the hands raised by the referee were Park Si-hun’s. Park had an embarrassed look on his face, and in a display of human decency, lifted Jones into the air.

In the recent superfight between Canelo Álvarez and Gennady Golovkin, one of the scorecards sparked controversy yet again. Amidst all the discussions following the fight, one that stood out to me was Teddy Atlas debating for an entire hour on ESPN. Never in my life have I seen someone speak with this much passion, while expressing their anger and disgust. And if you take the time to understand his background you’ll understand why. He’s a veteran trainer who loves the sport and has devoted his life towards it. He’s one of the few people who knows what boxers have to go through to be successful. He knows the sacrifices they have to make. He knows what they put on the line day in and day out. Yet, due to corruption, their hard earned accomplishments can be taken away from them in one fell swoop.

It makes you wonder. What hurts more? Taking all those punches leading up to that moment, or swallowing an unjust loss?

A personal takeaway from this, is that life can sometimes be brutally unfair. And it doesn’t even have to be as a consequence of corruption. We have to remind ourselves this every time we’re too fixated on a certain goal or ambition in life. We have to ask ourselves if we’re also enjoying the actual journey itself, rather than the thought of reaching the destination. Because one day, unforeseen things can happen beyond our control, preventing us from ever reaching that destination.

The Importance of Marketing

To be regarded as a great boxer, you have to prove you can beat other boxers that are perceived to be great. As boxing lacks structure, you cannot force an opponent to step inside the ring with you.

If you aren’t marketing yourself well as you rise through the ranks, a consequence will be that other good fighters will evade you. If your boxing skills are through the roof, but you cannot sell out arenas and generate pay-per-view revenue, it makes little sense for other promoters to risk their boxers on you. On the other hand, if you’ve built up your personal brand well, opponents will line up to fight you even though they have little chance of beating you.

Some boxers have a harder time than others. They lack natural charisma. Their fighting style is too technical, as opposed to being an aggressive knockout artist. They don’t come from a country where the entire nation will rally behind them.

Floyd Mayweather and Conor McGregor face-off
Two master marketers in Floyd Mayweather and Conor McGregor showing how it's done

The boxer who mastered the art of marketing was Floyd Mayweather, having generated $1.3 billion in revenue throughout his career. Through boastfulness and flaunting his wealth, he created a persona that people hated. As he was such an exceptional boxer, he dangled his undefeated record like a carrot on a stick. Casual fans were paying for the chance of seeing him finally lose, while hardcore fans marveled at his skills.

Earlier this year, Mayweather came out of retirement to fight Conor McGregor in a boxing match. As they both walked away with hundreds of millions of dollars after the fight, I can’t help but think about a subject I touched on before. While both men are entertainers and great in their own right, the fight sold as well as it did because people believed McGregor had a chance. The marketing campaign led people to believe this would be a competitive match, rather than a spectacle. It was successful, because the average person doesn’t realize that, despite boxing and MMA being combat sports, they are still worlds apart. Leading up to the fight, when high-profile boxers (without a vested interest in marketing it) were asked about who would win the fight, you could tell it annoyed them. They felt that the suggestion alone of McGregor having a chance was disrespectful towards the sport of boxing.

This is a feeling I can relate to every now and then when it comes to software. I feel like some people, who lack an understanding of software and what it takes to create great products, marginalize the very profession I care so much about.

The Inspirational Side of Boxing

Looking beyond the cruel surface of boxing, what I find is something inspirational. It astounds me that there are people out there with the competitive spirit to step into the ring and excel. That there are people out there born into poverty with all the odds stacked against them. But because they had that innate drive, they endured more hardships and ended up forging a better future for themselves and their family.

The fight is won or lost far away from witnesses - behind the lines, in the gym, and out there on the road, long before I dance under those lights.
- Muhammad Ali

In the world of boxing, my favorite quote is by the late Muhammad Ali. Today, due to the Internet and social media, we focus a lot on instant gratification. We read about accomplishments and watch highlights and award shows. We see couples in happy relationships. We see athletes break world records. We see actors put on masterful performances. We see entrepreneurs sell their startups for millions of dollars. What we don’t see, unless we look for it, are the tens of thousands of hours of work they’ve put in to get to where they are.