Some people discover their love of books in school. But for bestselling author James Patterson, it took working the graveyard shift at a psychiatric institution.

Patterson, the novelist and philanthropist, talked about his journey into literature in an appearance on BookTube, YouTube’s talk show featuring notable authors.

“I was a high school valedictorian; I did not like to read,” Patterson said. “The books that they gave us, all the way through high school, nothing turned me on. I then worked my way through college at a mental institution, and if I did night shifts, there wasn’t much to do, and I started reading my brains out. I would go into Cambridge three times a week and get a stack of books, and that’s what turned me on.”

Patterson might not have brought the world iconic characters like Alex Cross if he’d listened to one of his teachers.

“I remember I was in college, there was a writing class you had to take, and the teacher said, ‘James, you write well enough, but stay away from fiction,’” he said. “So of course when you get that kind of encouragement, you go and write even more fiction.”

The author talked about his childhood in upstate New York, where he grew up in a family that didn’t have much money.

“I’ve been poor, I’ve been middle class … and now I’m rich,” he said. “On balance, I prefer rich. But I’m really happy that I went through a lot of stuff. I think it’s helped me as a human being; I think it’s helped me as a writer to understand where people are coming from, what their needs are.”

He also discussed how he researches locations for his thriller novels. “The process is like this: If it’s Hawaii, I’ll tend to go,” he said. “If it’s a crack house in the Bronx, I’ll tend to send another researcher.”

Michael Schaub is an Austin, Texas–based journalist and regular contributor to NPR.