more docs and renamed function