implemented pathlength class method