[doc] add comments to function