add path length in Path class
fix result reshaping