move calcEditDistances outside calcSplices