Finished r caching functions