add method for finding longest path