Add doc-strings, standardize function names.