Creating the two required functions

Contributed two functions, that enable a cached version of the solve()
function.