private int[] getTarget() {
        // find the best target based on distance and current rotation of my tank
        // return rotation to hit the target
        
        InfoDetail chosen = null;
        int distX, distY;
        double dX, dY;
        double angle;
        double distance, minDistance;
        int closest;
        int[] ret = new int[2]; // targetAngle, distance
        
        distance = minDistance = 10000;
        
        
        // fill distances list 
        if (this.data != null) {
            for (InfoDetail o : (this.data.getEnemies())) {
                if(o != null) {
                    distX = Math.abs(this.x - o.getX());
                    distY = Math.abs(this.y - o.getY());
                    distance = Math.sqrt((distX*distX) + (distY*distY));
                    if (distance < minDistance) {
                        minDistance = distance;
                        chosen = o;
                    }
                }
            }
            if (chosen == null) {
                ret[0] = -1;
                ret[1] = -1;
                return ret;
            }
            // get angle
            //System.out.println("My tank on: " + this.x + " : " + this.y + " ");
            distX = Math.abs(this.x - chosen.getX());
            distY = Math.abs(this.y - chosen.getY());
            
            distance = Math.sqrt((distX*distX) + (distY*distY));

            angle = Math.toDegrees(Math.atan((double)distY/distX));
//            System.out.println("Distance: " + distX + " / " + distY + ", target angle = " + angle);

            if (chosen.getX() > this.x) { // target is to the right => 1st or 4th quadrant
                if (chosen.getY() > this.y) { // 4th quadrant
                    
                    angle = 0 + angle;
                    
                    /*
                    if ((chosen.getDirection() > 300 && chosen.getDirection() < 360) || (chosen.getDirection() > 0 && chosen.getDirection() < 60)) {
                        if (distance < 100) angle -= 4;
                        else if (distance > 100) angle -= 8;
                        else angle -= 12;
                    }
                    if ((chosen.getDirection() > 120 && chosen.getDirection() < 240)) {
                        if (distance < 100) angle += 4;
                        else if (distance > 100) angle += 8;
                        else angle += 12;
                    }
                    */
                    
                } else { // 1st quadrant
                             
                    angle = 360 - angle;
                    
                }
            } else { // target is to the left => 2nd or 3rd quadrant
                if (chosen.getY() > this.y) { // 3rd quadrant
                    angle = 180 - angle;
                                        
                } else { // 2nd quadrant
                    angle = 180 + angle;
                }
            }

            ret[0] = (int)angle;
            ret[1] = (int)distance;
            return ret;
        } // this.data is null
//        System.out.println("data is null!");
        ret[0] = -1;
        ret[1] = -1;
        return ret;
    }