Improve docs for function