path calculating