modified editDistance.java file