fixed generatePath so that it uses instance of this