it would be awesome to have a bit more function documentation as to what this function does