improved findLine performance