RELATED STORIES Big Brother All-Stars Recap: Who Became the First Member of the Jury?

Big Brother All-Stars Recap: Who Became the First Member of the Jury? CBS Sunday Night Movies to Resume in October, Forcing Big Brother to Move

Stop me if you’ve heard this one before, but the originally envisioned closing scene for Hawaii Five-0‘s series finale actually aired back in September 2016.

The sequence in question instead wound up opening the CBS drama’s Season 7 premiere, where a recently injured Steve McGarrett wheeled himself into the chapel at Tripler Army Medical Center. Sitting alongside the pews, McGarrett struck up a conversation with a stranger nearby, whom he later learned had also been a cop in Hawaii.

“Sometimes it feels like this job of mine has taken everything good from me,” Steve lamented. “Son, what we do can’t be quantified,” counseled the stranger. “The best legacy a man can leave behind is the people whose lives he has changed.”

That retired lawman… was played by a CGI version of the late Jack Lord, aka McGarrett on TV’s original Hawaii Five-O.

When showrunner Peter M. Lenkov first came up with the idea for the unexpected cameo, he pictured it as the series’ very final scene. But coming out of Season 6, he realized Five-0 wouldn’t be ending anytime soon, and he wanted to tackle this bit of computer trickery before another show did similar.

When envisioned as the end of a series finale, “I actually wrote the scene very differently,” Lenkov tells TVLine. “The end of the show was McGarrett sitting on a bench, and this older man sits down next to him. McGarrett talks about his life and his focus and his commitment to the task force, and how it made him sort of sacrifice everything else, and the Jack Lord character says very much what was in that Season 7 episode — which is, what you’re doing is your legacy.”

That meeting of lawmen “was going to end with McGarrett looking back over, and the guy is gone. The phone rings, and he says, ‘McGarrett…. I’ll be right there.’ So you know that even though he was considering maybe hanging it up, that conversation allowed him to realize that this is who he is. The audience would know that the task force would continue under his leadership.”

The only downside to pulling the trigger on the cameo when he did was “the visual effects were not there yet,” Lenkov acknowledges. (To create “Jack Lord,” as the character was credited, Five-0 used a combination of a soundalike voice actor, a real actor who has the same bone structure, and CG work laid over the stand-in’s face. Lord’s estate had approved the script months earlier, knowing that it was about honoring the actor’s legacy.) “If I did it today, it would be much better,” Lenkov notes. “Every year, every month, [the technology] changes and it becomes so much better, and we were just too early with it. But that was my original ending.”

Also perhaps of note: In the Season 7 scene, the Jack Lord character — speaking of his 40-year marriage — assured Steve, “I’m sure the right woman is out there for you somewhere.” To which Steve said, “What if I already met the right woman and I couldn’t hang onto her?”

“Then she wasn’t the right woman,” Jack Lord suggested. Steve, though, countered, “See, I’m not so sure about that.”

Watch the opening scene of Season 7 at CBS.com.