We’ve all heard about the gender gap in tech. Women simply aren’t thriving in one of the most promising fields in the United States — and not for lack of talent. And here’s the truth: It’s not solely a problem for women. It’s a problem for men, too. In just five years, there will be a million unfilled computer science–related jobs in the United States, which according to our calculations could amount to a $500 billion opportunity cost. Tech companies are producing jobs three times faster than the U.S. is producing computer scientists. There are incredible opportunities here. We need women to help fill these jobs, and we need them now.

The reasons why women and people of color are not pursuing computer science jobs are complicated. I’ve thought a lot about this over the past 16 months, as I’ve directed my documentary on the subject, Code: Debugging the Gender Gap, and I believe there are four main reasons women don’t thrive in tech. Here they are:

1. Culture

First and foremost, this is a culture problem. The stereotype of a software engineer is a 25-year-old, hoodie-clad dude who wears glasses, is antisocial, and loves to hack strings of code in the basement of his parents’ home, eating stale pizza and drinking Red Bull until 3 or 4am. As with all stereotypes, there’s some truth here, and it’s not the most aspirational image for a young woman. Old movies like War Games contributed to the stereotype, while the image of the male geek genius is perpetuated in modern pop culture with television shows such as HBO’s Silicon Valley and The Big Bang Theory.

2. Few role models

Which leads me to another huge reason we have a gender imbalance: Tech is basically devoid of female role models. The old adage “You cannot be what you cannot see” is true here. Young girls and people of color have very few modern-day role models in tech. Megan Smith is the Chief Technology Officer of the United States, but she’s hardly a household name. We need more modern-day female role models, many more.

3. Poor pipeline

At most universities, few women make it past the 101, entry-level computer science class that should welcome all students, regardless of their prior knowledge of the subject. Instead, women entering this first-year class too often suffer from negative ambient belonging. From the first day there, they perceive that the men in the class know much more about programming than they do. And they are often right. In part, I blame this on the gaming industry. Gaming has traditionally been marketed to boys, so by the time these boys get to college, the ones who enter CS classes have likely been gaming for over 10 years. Through finding cheats and discovering the inner workings of games such as Call of Duty and GTA V, gamers can develop an understanding of the fundamentals of programming. With the recent explosion of mobile games, there exists an enormous opportunity to design games that appeal to girls and young women — and create more familiarity with code.

4. Sexism

Then there is the issue of plain, old-fashioned sexism. Like it or not, it’s present in the misogynistic nuances in startup culture, in the good ol’ boys corporations of the South, and even in the classrooms and administration of America’s educational system. Sexism might not present itself as it did in the 1960s Mad Men era; instead it is latent, subtle, but still very present. It’s things like not being heard in a meeting or a classroom discussion. It’s the assumption that if you are the woman in the meeting, you are the admin, or you brought the coffee. It’s being interrupted. It’s not being given the chance to prove yourself.

So what now?

So what do women do about these challenges? I talked to countless women in the course of working on the Code documentary. Certain common solutions have surfaced time and again: Women need to be more assertive; we should stop apologizing all the time. We should ask for raises and believe we are worthy of that raise. Younger women should find a sponsor — not just a mentor, but a true sponsor who will go to bat for their career.

Above all else, women need to support women. We often have to work harder than men to prove our worth in the workplace — and this means that sometimes we don’t look up from our desks in order to reach out and support a co-worker. That’s got to stop.

And finally, we need male allies, because we need each other in the workplace. Teams with women are more productive, have a higher collective IQ, and achieve more. Teams with women have a broader perspective that results in the creation of products that serve a greater breadth of humanity. Women offer diversity, and diversity drives innovation.

“A true male ally,” one woman said to me recently, “is a man who is willing to defend women when there are no women in the room.” So men, stand up and be counted. It will help us all.