Cached solve for matrix
Add comments