I can't refer the variable result that's definitely in scope for the function for some reason. Also, Looking at the source code, the code is actually different than the one shown here. 