Fixed docstrings, added functions for external use.