Add comments and make "if" statemnet clearer.

#6179 

Addressing comments for #6180.