Russian doll caching

fixes #28