added comment to clarify if/else block