Fix indents and add docstring for helper function