Soapy's thoughts are interrupted by the long arm of the law.
That long arm is attached to the sixth policeman we see in the story. He arrests Soapy for loitering, or vagrancy (not having a place to live or a way to support yourself). The next morning, a judge sentences Soapy to three months in jail. Want to talk more about this very sudden ending? Check out