Caching is optional
Flatten
Add cache test