added brief comments to functions