OnlinePathfing 1 (piecwise in cause of sone trubles)