adding caching and stuff