working true path alg