Read this passage from the story "After Twenty Years" by O. Henry. Then, answer the question(s).

(1) The policeman on the beat moved up the avenue impressively. (2) The impressiveness was habitual and not for show, for spectators were few. (3) The time was barely 10 o'clock at night, but chilly gusts of wind with a taste of rain in them had well nigh de-peopled the streets.

(4) Trying doors as he went, twirling his club with many intricate and artful movements, turning now and then to cast his watchful eye down the pacific thoroughfare, the officer, with his stalwart form and slight swagger, made a fine picture of a guardian of the peace. (5) The vicinity was one that kept early hours. (6) Now and then you might see the lights of a cigar store or an all-night lunch counter; but the majority of the doors belonged to business places that had long since been closed.

Why is the policeman walking along the street and checking the doors of the buildings that he passes?

A. He is trying to find out if a criminal is hiding in one of the buildings.
B. He is trying to prove to anyone watching that he is doing his job.
C. He is hungry and wants to find an all-night lunch counter that is open.
D. He is making sure that the doors are locked and the businesses are safe.