Added nice comments to the code.