Completed functionality of makeCacheMatrix and cacheSolve