doc: lots of function docs.