Can you please document the function a bit further? It is not really obvious to me what it does.