created functions to solve and cache matrix inverse