now caching variables by nesting level