private void newBabbleAttempt_init()
    {
        // reset the wrist and finger joints (full open)
        Hand h=((Hand)this);
        resetRotCnt();  // Wrist rotation starts from zero

        h.root.unBlock(); // reset the blocked fingers from prior babbles
        h.resetJoints();
        ////setJointAngle(h.j1,-60*Math.PI/180);
        //setJointAngle(h.wristx,-80*Math.PI/180);
        babble_phase=bab_ph_REACH1;
        babbleStatus=babble_REACH1ON;
        System.out.println("Babbles ( success/attempts):"+babble_succ+"/"+babble_trials);
        if (bj1==null)
        {
            bj1=getJoint("J1");
            bj2=getJoint("J2");
            bj3=getJoint("J3");
            bj4=getJoint("J4");
        }
        setJointAngle(bj1,-Math.PI/2);
        //setJointAngle(bj2,-Math.PI/4);
        //setJointAngle(bj3,0);
        setJointAngle(bj4,80*Math.PI/180);
        //setJointAngle(h.thumb,90*Math.PI/180);
        //setJointAngle(h.thumb.child[0],10.7*Math.PI/180);
        //setJointAngle(h.thumb.child[0].child[0],55.7*Math.PI/180);
        h.makeBabblePose();
        HV.cv.refreshDisplay();
        //mp=HV.mcirc.nextMotorPlan(h,obj);
        // get new input
        if (location_trials==0)
        {
            System.out.println("Getting the next random input....");
            Point3d newinput=HV.mcirc.nextRandomInput();
            if (HV.FANCY>0)
            {
                if (Mars.starc>200)
                    Mars.clearStars();
            }
            else if (Mars.starc>5)
                Mars.clearStars();
            // Mars.addStar(newinput);
        }

        location_trials=(location_trials+1) % MAXREACH;

        mp=HV.mcirc.nextNoisyMotorPlan(h,obj,offRandomness,0,rotRandomness);
        //-> Mars.addComet(obj.objectCenter,mp.reachTarget,1);
        if (HV.DLEV>0)
            mp.printInfo();
        //restoreAngles(reachConfig);
        ///constrainedRotate(h.wristz, mp.bank-h.wristz.beta);
        ///constrainedRotate(h.wristx, mp.tilt-h.wristx.beta);
        // to show the offset reaches
        // ->Mars.addStar(VA.add(obj.objectCenter,mp.reachOffset));
        HV.cv.refreshDisplay();
        //Mars.addStar(VA.add(obj.objectCenter,mp.reachOffset));
        //System.out.println("Reach offset:"+mp.reachOffset.str());
        obj.reachoffset(mp.reachOffset);
        obj.beforeAction();
//  	if (HV.FANCY>0) {
//  	if (babble_trials % 100 == 0) Mars.clearStars();
//  	Mars.addStar(mp.reachTarget);
//  	}
        ntick=0;
        storeAngles(initialConfig);
        if (HV.FANCY>0 || HV.DLEV>0)
            infoRate=1;
        else
            infoRate=10;
    }