Add caching, disabled for tests. Add more docstrings.
Fix comment