add function docs and rename param