add comments on block of code to explain conditional statement