new unit test for long paths (1000 stations)
cosmetics
refactoring to remove code duplication
fixed the loop detection in the backtracking's reject.