Added comments to the closures, and changed a couple of argument names so that they are more meaningful