add comments to fix bugs