The R-rated film "Logan" is getting praise from audience and critics alike. The script is ambitious and tightly packed with an equal amount of action sequence and drama.

The story of "Logan" is engaging, Hugh Jackman's performance is mind blowing and it stands out in the whole X-Men franchise. In an interview with The Hollywood Reporter, "Logan" screenwriter Scott Frank opened up about the ending of the movie.

Beware, the following information contains spoilers.Fans who have watched the movie were somewhat expecting the death of Logan, but when Professor X died too, it came as a shock.

Frank explained the thought process that went into killing Hugh Jackman's character.The screenwriter stated that they wanted to highlight the complex father-daughter relationship in the movie.

"We kept it personal the whole time. That's really what we were obsessed with," The Hollywood reporter quoted Frank. "You could feel it as we were writing it - that it was accruing to something powerful at the end,"

As per The Entertainment Weekly, director James Mangold first came up with the idea that Logan should die at the end of the new film. Actor Hugh Jackman was open to as long as it's done in the right way.

Jackman stated that he agreed to another Wolverine movie to give the character a much-needed ending. The ending of Logan is also the reason why the actor decided it will be his last one.

He also stated that Logan is scared of intimacy and it has been established well in the past 17 years. But the idea that in the end, Logan must sacrifice his life save someone else, Hugh Jackman though it's really powerful.

"Logan" earned $85.3 million is its opening weekend. With this, the Hugh Jackman movie became the fifth best debut for an R-Rated movie.