Can you please add a docstring / comment which describes how this function works (as I described it in my previous comment).