Add a few comments to clarify less obvious logic