add comments to help understanding the code.