public static void goAwayFromHQEscapeMines(MapLocation location) throws GameActionException {
    MapLocation currentLocation = rc.getLocation();
    // Find the closest space that doesn't have mines
    for (int i = -3; i <= 3; i++) {
      for (int j = -3; j <= 3; j++) {
        // ignore squares at corners (vision only 14 squared distance)
        if (!((i == -3 || i == 3) && (j == -3 || j == 3))) {
          MapLocation iterLocation = new MapLocation(i + currentLocation.x, j + currentLocation.y);
          Team mineTeam = rc.senseMine(iterLocation);
          if (mineTeam == null) {
            // go to that square
            safeLocationAwayFromHQMines = iterLocation;
            goToLocationDontDefuseOrAvoidMines(iterLocation);
          }
        }
      }
    }

    Direction dir = rc.getLocation().directionTo(location).opposite();
    if (dir != Direction.OMNI) {
      goDirectionAndDontDefuseOrAvoidMines(dir);
    }
  }