static List<Dir> aStar(char[][] board, Position start, Position target, boolean dressed) {
    Node init = new Node(start.x, start.y, 
        getHeuristic(start.x, start.y, target), new ArrayList<Dir>());
    PriorityQueue<Node> queue = new PriorityQueue<Node>();
    queue.add(init);
    while (queue.size() > 0) {
      Node state = queue.poll();
      if (state.x == target.x && state.y == target.y) {
        return state.path;
      }
      if (canEnter(board, state.x + 1, state.y, dressed)) {
        List<Dir> copy = new ArrayList<Dir>(state.path);
        copy.add(Dir.DOWN);
        queue.add(new Node(state.x + 1, state.y, 
            getHeuristic(state.x + 1, state.y, target), copy));
      }
      if (canEnter(board, state.x - 1, state.y, dressed)) {
        List<Dir> copy = new ArrayList<Dir>(state.path);
        copy.add(Dir.UP);
        queue.add(new Node(state.x - 1, state.y, 
            getHeuristic(state.x - 1, state.y, target), copy));
      }
      if (canEnter(board, state.x, state.y + 1, dressed)) {
        List<Dir> copy = new ArrayList<Dir>(state.path);
        copy.add(Dir.RIGHT);
        queue.add(new Node(state.x, state.y + 1, 
            getHeuristic(state.x, state.y + 1, target), copy));
      }
      if (canEnter(board, state.x, state.y - 1, dressed)) {
        List<Dir> copy = new ArrayList<Dir>(state.path);
        copy.add(Dir.LEFT);
        queue.add(new Node(state.x, state.y - 1, 
            getHeuristic(state.x, state.y - 1, target), copy));
      }
    }
    return null;
  }