Here are my suggestions for this exercise Enjoy !!! I give the class, then the methods i think it needs below. ComptonDatum ------------ // This method is to initialise it from the values in the file // This is just like ThreeVector initialise( float angle, float energy, float error ) // This method is to calculate the chisq contribution from this datum float chiSquared( float mass ) Histogram ---------- // Do this later DataReader -------------- // Only needs one method, // Its job is to go to the specified file, read it and for each line // create a new ComptonDatum. These should be pushed into a vector // which is then returned to the caller of the method vector getData( string filename ) Minimiser --------- // To set the initial guess at the mass, and the chisq change for convergence initialise( float initialParameter, float convergence ) // gives the client the current guess at the mass float getCurrentParameter( ) // You use this to give the minimiser the chisq corresponding to the mass // it gave you void setChiSquared( float chisq ) //-------------------------------------------------------- // Here is some (incomplete) code to outline how it might all work together. int main() { // Read file and create datum objects vector measurements ; DataReader myReader ; measurements = myReader.getFromFile( "filename" ) ; // Make a minimiser and intialise it Minimiser massFitter ; float mass = 500 ; massFitter.initialise( mass ) while( massFitter.isMinimising() ) { mass = massFitter.getCurrentParameter( ) ; float chisq = 0 ; for( ............. ) { chisq += measurements[ind].chiSquared( mass ) ; } massFitter.setChiSquared( chisq ) ; } // print out final mass mass = massFitter.getCurrentParameter( ) ; cout << ......