private static void createPath(int from, int step, int to, int lMax, int lCurr, int places,
            ArrayList<Integer> road,final List<List> roads,final List<SynchroState> template){
        
        if(lMax == lCurr){
            if(step == to){
                road.add(step);
                roads.add(road);
            }
        }else{
            int [] neibs = SynchroState.getNeighbors(step, places);
            for (int neib: neibs){
                if((!road.contains(neib))){
                    if(template.get(neib).state == null || lMax == lCurr+1){
                        ArrayList<Integer> new_road = new ArrayList<>(road);
                        new_road.add(step);
                        createPath(from, neib, to, lMax, lCurr+1, places, new_road, roads, template);
                    }
                }
            }
        }

    }