Could you add some docstring to that function, it doesn't look very trivial