better local variable names,  better docstring