Tech titan Marc Benioff's philanthropic group, Salesforce.org, is donating another $12.2 million to Bay Area schools to improve computer science education, and possibly make the next generation of Salesforce employees.

The gift of $7 million to San Francisco public schools and $5.2 million to Oakland public schools brings the total amount of money invested in the two school districts by Salesforce to nearly $35 million over the past five years.

In addition to funds that pay for things like teacher training and classroom math coaches, some of education donations come with very few strings attached. That's by design.

Five years ago, Salesforce began giving middle school principals $100,000 of unrestricted funds to use as they see fit as part of its Principal's Innovation Fund.

"They know what's going on on the ground," said Ebony Frelix Senior Vice President of Philanthropy & Engagement. "By giving them money that is not allocated by the district, you allow them to innovate and do what's best in the school."

The company, which is based in the San Francisco, expanded donations to the Oakland Unified School District in 2016, and included a number of the $100,000 grants.

When the group checked back at the end of the year to see how the money was used, it saw that a large portion was going to support immigrants and refugees who have been in the U.S. for less than three years. Many of the students are unaccompanied minors who fled violence back home.

The company is also including funds specifically earmarked to support immigrant and refugee students at the district level. The donations also pay for teacher training, tutoring and math coaches in the classrooms.

The chief goal for the multi-million dollar education donations is a drive to fund computer-science education. With this donation, Salesforce plans to do more measurement and evaluation to better understand the impact of its funds. In addition to money, Salesforce employees are committing to volunteer for 40,000 at the schools.

When the program started, there were 200 girls taking computer science classes in San Francisco public schools. Now there are 3,800. There's been a similar jump in enrollment among underrepresented groups, according to Salesforce. In Oakland, the number of kids enrolled in computer science courses has gone from 80 to 900. Of those kids, 29% are African American and 38% are Latino.

Related: Salesforce just spent another $3 million to close its pay gap

Salesforce.org is trying to get other tech companies more involved in public schools as well, though Salesforce is not alone in giving back. Facebook CEO Mark Zuckerberg and his wife Dr. Priscilla Chan pledged to donate $120 million to Bay Area schools starting in 2014.