pathgen algorithm added