algo change

now closer to the solution, but sometime still give bad result