Path generating algorithm added.