completed cacheSolve function, added comments