In this story, one of O. Henry's most important achievements is that of creating surprise. O. Henry does it by revealing only what is absolutely necessary for the reader to know in advance. He structures his passages in a way that focuses more on recollections than on present events. In this way, we learn about the two men from their own perspective, which places a lot of emphasis on their connection and closeness.
The author achieves surprise due to this, as the reader never expects a tragic ending after the relationship between the two men was so lovingly described. Moreover, he does not hint at the fact that the policeman and "Jimmy Wells" are not who they say they are. Nevertheless, O. Henry also uses foreshadowing successfully when talking about the past experiences of Bob. These suggest he might have some trouble with the law in the future.