lane generation with recursive method