Initial matrix caching script