public static Iterable<Direction> solve(State state)
    {
        State boxToGoal;
        int px = state.player.x;
        int py = state.player.y;
        ArrayList<Position> possiblePlayerPositions = possibleStartPositions(state);

        for (Position player : possiblePlayerPositions)
        {
            boxToGoal = Search.findBoxPath(state, player.x, player.y);
            if (boxToGoal != null){
                Search.Result result = Search.bfs(boxToGoal, new IsAtPosition(px, py), boxToGoal.player.x, boxToGoal.player.y);
                if(result != null){
                    Collections.reverse(result.path);
                    ArrayList<Direction> toReturn = Search.getPlayerPath(boxToGoal);
                    toReturn.addAll(result.path);
                    Collections.reverse(toReturn);
                    return toReturn;
                }
                else
                {
                    if (Main.DEBUG)
                    {
                        System.err.println("No path back");
                    }
                }
            }
            else
            {
                if (Main.DEBUG)
                {
                    System.err.println("No solution" + state.playerEndPos);
                }
            }
        }
        return null;
    }