modified editdistance,java