Programming Assignment submission for solving a matrix and caching the result