Variable cache

Tweaked variable caching