Added more comments to code.