Sentence: John was doing research in the library when he heard a man humming and  whistling. He was very annoyed.
 Reason: The 'He' refers to john because John is referred to as the pronoun here a word that can function by itself as a noun phrase and that refers either to the participants in the discourse. 
 Question: Is the above reasoning correct or wrong? 