added comments to function8