better rename a function and add comments