Even when real life has already told us the ending of the story, the best movies make us forget for a little while that we know what’s going to happen. We’re caught up in the moment, no more sure of what’s going to happen than the characters living it.

“Captain Phillips,” the new Tom Hanks movie based on the shipping captain who survived an encounter with Somali pirates, manages that impressive feat more than once. It’s a nerve-wracking movie in the best possible way, thick with tension and buoyed by excellent performances from the two main leads.

Hanks, wisely stripping himself of most of his usual character quirks, plays Captain Richard Phillips as a serious, sober man trying to get a shipment of market items and relief food through pirate infested waters. He clearly believes in rules and procedures, and his relationship with the rest of the crew is far from warm. Rather than the dynamic ship captain of so many heroic tales, Phillips is more of a hard-working middle manager who believes in the job he’s doing.

It’s that averageness, however, that makes his later heroism that much more profound. He routinely puts himself in danger to save his men, not because he loves them but simply because that’s the captain’s job. He fights with words and reasoning rather than fists, but those words clearly have an impact.

The other standout performance is from Barkhad Abdi, the unknown playing a pirate named Muse. The unofficial leader of the group of pirates who take Phillips’ ship, Abdi perfectly poises Muse between an almost charismatic violence and the genialness of a man just trying to get an unpleasant job done as quickly and efficiently as possible. Abdi has a hypnotic voice and a habit of swaying back and forth slightly at times, evoking a snake as it zeros in on his prey. In those moments, he’s absolutely terrifying.

There are other moments, however, where Abdi gives his character the very recognizable desperation of a man trying to do his job in increasingly impossible circumstances. When he says there are no other employment options in Somalia other than fishing and piracy, there’s so much resignation in his voice that it’s hard not to believe him. He’s the villain in this story, true, but he might have been the hero in a different tale.

It’s between these two men that the real power of the movie can be found. In many ways they’re in the same position, though circumstance has put them on opposite sides, and they battle each other with understanding as much as they do threats and guns. Danger is constantly present, often in the form of a knife at someone’s throat or a gun pressed to their head, but it’s the words that will determine whether or not the trigger is pulled. Even the smallest sentence could save a life, or end it.

The only place where the words really fail the audience is at the beginning of the movie, in what is supposed to be a domestic conversation between Hank’s character and his wife. The hug they give each other shows their marriage is clearly loving, but the dialogue between the two feels more like canned speeches than the way real people talk. Scriptwriter Billy Ray may know the right thing to say in battle, but he’s left fumbling when it comes to peace.