public static boolean simulate(double height, double v, double angle, double maxX, double[] targetY){
        if(parameterCheck(height, v, angle, maxX, targetY)==false){//is the input bad?
            return false;//stop
        }
        y0 = height;
        v0 = v;
        a = angle;
        targetX = maxX;
        hitbox = targetY;
        double CD = CD0 + CDA*Math.pow((angle-A0)*Math.PI/180, 2);//Figures Drag Coefficient
        double CL = CL0 + CLA*angle*Math.PI/180;//Figures Lift Coefficient
        //Initial
        reset();
        y=height;//frisbee leaves from height
        vx=v*Math.cos(angle*Math.PI/180);//Initial X velocity
        vy=v*Math.sin(angle*Math.PI/180);//Initial Y velocity
        
        while(y>0 && x<maxX){//while it hasn't hit the ground and hasn't reached the target X distance
            double dVY = ( RHO * Math.pow(vx,2) * AREA * CL / 2 / MASS - GRAV ) * EULER_STEP;//change in Y velocity.
            double dVX = ( RHO * Math.pow(vx, 2) * AREA * CD / 2 / MASS ) * -EULER_STEP;//change in X velocity.
            vx += dVX;
            vy += dVY;
            x += vx * EULER_STEP;
            y += vy * EULER_STEP;
            if(y>maxHeight){//checks to see if it peaks here
                maxHeight=y;//if so, this is the peak
                at=x;//peak occurred at this x value
            }
            t += EULER_STEP;//keeps track of flight time  
        }
        if(y<0){//if it goes "underground" because of an extra iteration, say it hit the ground
            y=0;
        }
        xErr = x-maxX;
        if(xErr<.1 && xErr>0){//If it goes past the x bound because of an extra iteration, say it hit the wall
            xErr=0;
            x=maxX;
        }
        if(y>targetY[1]){//positive error if it lands above the upper boundary of the hitbox
            yErr=y-targetY[1];
        }
        else if(y<targetY[0]){//negative error if it lands below the lower boundary of the hitbox
            yErr=y-targetY[0];
        }
        else{yErr=0;}//in the hitbox.
        return true; 
    }