added comments to all public functions.