private int whichIsFirst(int... pos) {
        int minPos = -1;
        for (int i = 0 ; i < pos.length ; i++) {
            if (pos[i] < 0) {
                continue;
            }
            if (minPos < 0) {
                minPos = i;
            } else {
                if (pos[i] < pos[minPos]) {
                    minPos = i;
                }
            }
        }
        return minPos;
    }