private boolean smartMove(RobotController rc, Boolean takeTwo) throws GameActionException {
        Direction dir;
        if(takeTwo) {
            dir = Direction.values()[(int)(rndGen.nextFloat() * 8)];
        } else {
            if(this.destination==null){
                this.destination = this.enemyHQ;
            }
            dir = rc.getLocation().directionTo(this.destination);
        }
        MapLocation moveTo = rc.getLocation().add(dir);
        Team isMine = rc.senseMine(moveTo);
        if(isMine != null) {
            // There's a mine here!
            if(isMine != rc.getTeam()) {
                // Enemy mine detected!
                rc.defuseMine(moveTo);
                return true;
            } else if(rc.canMove(dir)) {
                rc.move(dir);
                return true;
            } else{
                if(takeTwo) {
                    return false;
                } else {
                    return smartMove(rc, true);
                }
            }
        } else if(rc.canMove(dir)) {
            if (rndGen.nextFloat()*10<2.0) {
                // Lay a mine
                rc.layMine();
                return true;
            } else{
                rc.move(dir);
                return true;
            }
        } else {
            if(takeTwo) {
                return false;
            } else {
                return smartMove(rc, true);
            }
        }
    }