Added additional comments to functions