removed loop and unused var, since this is a sensitive (and not my) area - I did some mesh comparisons and ran a comparison with the old function passing random values, so this should be ok.
removed loop and unused var, since this is a sensitive (and not my) area - I did some mesh comparisons and ran a comparison with the old function passing random values, so this should be ok.