Preliminary function

Preliminary function to get matrix and cache solved matrix.