adding code for inversion/caching to shell