adjusted solve from makeCacheMatrix