Added comments to functions