added docstring and whitespaces