line reduction, levinstein distance