caching added closes #9