added simple caching (unfinished)