fixed example and added comments to new functions