Added more comments to the source code.