Rename variables, add docstring