@Override
    public void iterate() {
        try {
            if (isAllyControlled()) {
                targets = renderer.getEnemyShips();
            } else {
                targets = renderer.getAllyShips();
            }
        } catch (NullPointerException ex) {
            this.setRemovable();
        }

        try {
            int closest = 999999;
            double closestDistance = 999999;
            for (int i = 0; i < targets.size(); i++) {
                // If target is closer than previous ones, and the target isn't destroyed already...
                if ((getDistanceTo(targets.get(i)) < closestDistance) && (!targets.get(i).isDestroyed())) {
                    closestDistance = getDistanceTo(targets.get(i));
                    closest = i;
                }
            }

            if (closestDistance != 999999) {
                double angle = -getRelativeAngleTo(targets.get(closest)) / Math.PI * 180;
                if (angle < -3) {
                    turn(-3);
                } else if (angle > 3) {
                    turn(3);
                }
            }
        } catch (Exception e) {
        }

        super.iterate();
    }