The former high school dropout wanted to set a good example for his four kids

Actor and producer Mark Wahlberg has a new title to add to his resume – high school graduate.

The 42-year-old received his diploma in June and tells PEOPLE that his four children were a big motivation for hitting the books. “I didn’t want the kids saying, ‘You didn’t do it, so why do I need it?’ They are all wanting to do things in their future that require an education.”

Get push notifications with news, features and more.

The Ted star, who had a troubled childhood and dropped out in the ninth grade being charged with attempted murder, says getting his diploma is “a huge accomplishment.”

“It’s also a huge sense of relief,” he told PEOPLE Monday at an event in Irvine, Calif., for the Taco Bell Foundation for Teens, where he presented scholarships to select Taco Bell employees as part of its pilot program. “I wondered, ‘Why didn’t I do it when I was there?’ It’s so much harder at 41 going back and trying to do all these difficult tasks.”

The most challenging part for Wahlberg, who took online classes, was math, even though he jokes that he’s “good at counting money and keeping track of my money.”

Wahlberg hired a tutor and studied between takes on the set of Two Guns, but kept it a secret from his costar Denzel Washington.

“Denzel was always asking me what I was doing but I didn’t want to share that information with him,” he says. “Nobody knew, because I felt like I don’t like to count my chickens before they hatch, so I didn’t want to say that I was doing it until I actually finished it. What if I said I’m doing this and I didn’t finish it?”

Now that Wahlberg has his diploma, he’s hoping to further his education.