Finished up basic caching code