Now runs rangeapply, diffs are tiny, need to fix issues with local variables.