the begginings of line search