diff --git a/ising/include/metropolis.h b/ising/include/metropolis.h
index ea88218..3dd9859 100644
--- a/ising/include/metropolis.h
+++ b/ising/include/metropolis.h
@@ -4,7 +4,7 @@
 #ifndef METROPOLIS_C
 extern void metropolis_ising( short int *x ,int N, double BETA);
 extern double delta_Ham_ising ( short int * configuration,int a, int b, int N);
-extern double hamiltonian_ising(short int * configuration, int N);
+extern double hamiltoniana(short int * configuration, int N);
 void spin_init (short int * configuration, int N);
 inline void savePPM(short int * x, int N);
 inline double magnetization(short int *x, int N);
diff --git a/ising/metropolis/Makefile b/ising/metropolis/Makefile
index 0bd06cb..d777f21 100644
--- a/ising/metropolis/Makefile
+++ b/ising/metropolis/Makefile
@@ -21,12 +21,12 @@ all: rmxeq mkdep mkxeq

 MAIN = ising

-MODULES = metropolis mtwist
+MODULES = metropolis mtwist raccolta_dati
 # search path for modules

 MDIR = ../modules

-VPATH = $(MDIR)/metropolis:$(MDIR)/mersenne
+VPATH = $(MDIR)/metropolis:$(MDIR)/mersenne:$(MDIR)/dati

 # additional include directories
diff --git a/ising/metropolis/ising b/ising/metropolis/ising
index 4ac3684..c5fcac1 100755
Binary files a/ising/metropolis/ising and b/ising/metropolis/ising differ
diff --git a/ising/metropolis/ising.c b/ising/metropolis/ising.c
index 13bd652..5e50833 100644
--- a/ising/metropolis/ising.c
+++ b/ising/metropolis/ising.c
@@ -6,22 +6,20 @@
 #include "mtwist.h"
 #include "constants-metro.h"
 #include "metropolis.h"
+#include "raccolta_dati.h"

-
-
+#define CORR_MAX 50

 int main (int argc, char *argv[]){
 	mt_seed();
 	double BETA = 1;
 	int N ;
 	int iteration = 0;
-	double mag_abs_mean=0; // Valor medio del modulo della magnetizzazione
 	double mag2_mean=0; // Valor medio di magnetizzazione al quadrato
-	double mag_mean = 0; // valor medio di magnetizzazione
+	double mag_mean = 0; // valor medio di modulo magnetizzazione
 	double chi = 0;
-	double tmp= 0;
 	double * S_n;
-	int i = 0;
+	int i ;
 	if (argc>1){
 		BETA = atof(argv[1]);
 		N = atoi(argv[2]);
@@ -43,32 +41,67 @@ int main (int argc, char *argv[]){
 	configuration = malloc(N*N*sizeof(short int));
 	spin_init(configuration,N);
 	/***** FILENAMES AND FILE OPENING ******/
-	char mag_file[64] = "";
-	snprintf(mag_file,64,"data/magnetization_mean_%d.dat",N);
-	char chi_file[64] = "";
-	snprintf(chi_file,64,"data/chi_%d.dat",N);
-	char corr_row_file[64]= "";
-	snprintf(corr_row_file,64,"data/corr_row_%dParticle_%.3lf BETA.dat",N,BETA);
-	FILE * f_mag_mean = fopen(mag_file,"a");
-	FILE * f_chi = fopen(chi_file,"a");
-	FILE * f_corr_row = fopen(corr_row_file,"w");
+	char mag_filename[64] = "";
+	snprintf(mag_filename,64,"data/mag_mean%d.dat",N);
+	char chi_filename[64] = "";
+	snprintf(chi_filename,64,"data/chi%d.dat",N);
+	char mag_binning_filename[64] = "";
+	snprintf(mag_binning_filename,64,"data/binning/mag_N%d__B%.6lf.dat",N,BETA);
+	char en_binning_filename[64] = "";
+	snprintf(en_binning_filename,64,"data/binning/en_N%d__B%.6lf.dat",N,BETA);
+	char en_filename[64] = "";
+	snprintf(en_filename,64,"data/en_N%d.dat",N);
+	char en_autocorr_filename[64] = "";
+	snprintf(en_autocorr_filename,64,"data/en_autocorrN%d_B%.8lf.dat",N,BETA);
+	char en_temp_filename[64] = "data/en_temp.dat";
+	char mag_autocorr_filename[64] = "";
+	snprintf(mag_autocorr_filename,64,"data/mag_autocorrN%d_B%.8lf.dat",N,BETA);
+
+/*** I File sono chiamati: f_$(Nomestringa) ****/
+	FILE * f_mag = fopen(mag_filename,"a");
+	FILE * f_chi = fopen(chi_filename,"a");
+	FILE * f_mag_bin = fopen(mag_binning_filename,"w");
+	FILE * f_en_bin = fopen(en_binning_filename,"w");
+	FILE * f_en_autocorr = fopen(en_autocorr_filename,"w");
+	FILE * f_en = fopen(en_filename,"a");
+	FILE * f_en_temp = fopen(en_temp_filename,"w");
+	FILE * f_mag_autocorr = fopen(mag_autocorr_filename,"w");
+	FILE * f_corr_row = fopen("data/corr_row.dat","w");
+/**********************************************************************
+ TERMALIZZAZIONE
+ **********************************************************************/
+
 	while(iteration < ITERATION_THERM){
 		if(iteration %200 == 0){
 			printf("Iterazione: %d\n",iteration);
 		}
 		metropolis_ising(configuration,N,BETA);
 		iteration++;
+
 	}
 	iteration = 0;
+	double mag_tmp;
+	double en_tmp;
+	double en_mean =0;
+	double * mag_vet_dati ;
+	double * mag_vet_binnato;
+	double * en_vet_dati;
+	double * en_vet_binnato;
+	double * en_autocorr = malloc(sizeof(double)*CORR_MAX);
+	double * mag_autocorr = malloc(sizeof(double)*CORR_MAX);
+	en_vet_dati = malloc(sizeof(double)*ITERATION_MAX);
+	mag_vet_dati = malloc(sizeof(double)*ITERATION_MAX);
+	int larghezza_bin;
+
 	while(iteration < ITERATION_MAX){
-		if(iteration %500 == 0){
-			printf("Iterazione: %d\n",iteration);
-		}
 		metropolis_ising(configuration,N,BETA);
-		tmp = magnetization(configuration,N);
-		mag2_mean += tmp*tmp;
-		mag_abs_mean += fabs(tmp);
-		//mag_mean  += tmp ;
+		mag_tmp = magnetization(configuration,N);
+		en_tmp = hamiltoniana(configuration,N)/(double)(N*N);
+		mag_vet_dati[iteration] = fabs(mag_tmp);
+		en_vet_dati[iteration] = en_tmp;
+		mag2_mean += mag_tmp*mag_tmp;
+		mag_mean += fabs(mag_tmp);
+		en_mean+=en_tmp;
 		iteration++;
 		for ( i = 0; i<N;i++){
 		S_n[i] += sum_row(configuration,i,N);
@@ -79,17 +112,61 @@ int main (int argc, char *argv[]){
 		S_n[i]/=(double)ITERATION_MAX;
 		fprintf(f_corr_row, "%d\t%lf\n",i,S_n[i] );
 	}
-	mag_abs_mean /= (double)(ITERATION_MAX);
+	mag_mean /= (double)(ITERATION_MAX);
 	mag2_mean /= (double)(ITERATION_MAX);
+	en_mean /= (double)(ITERATION_MAX);
 	//mag_mean /= (double)(ITERATION_MAX);
-	chi = (mag2_mean - mag_abs_mean*mag_abs_mean)/(double)(N*N);
-	mag_abs_mean /= (double)(N*N);
-	fprintf(f_mag_mean,"%lf\t%lf\n",BETA,mag_abs_mean);
+	chi = (mag2_mean - mag_mean*mag_mean)/(double)(N*N);
+	mag_mean /= (double)(N*N);
+	mag_vet_binnato = malloc(sizeof(double)*(ITERATION_MAX));
+	en_vet_binnato = malloc(sizeof(double)*(ITERATION_MAX));
+
+	for ( larghezza_bin = 1; larghezza_bin < 100 ; larghezza_bin+=1){
+		binning(mag_vet_dati,mag_vet_binnato,ITERATION_MAX,larghezza_bin);
+		binning(en_vet_dati,en_vet_binnato,ITERATION_MAX,larghezza_bin);
+		fprintf(f_mag_bin,"%d\t%.14e\n", larghezza_bin,
+			sqrt(varianceOfDoubleArray(mag_vet_binnato,ITERATION_MAX/larghezza_bin)/(double)(ITERATION_MAX/larghezza_bin)));
+		fprintf(f_en_bin,"%d\t%.14e\n", larghezza_bin,
+			sqrt(varianceOfDoubleArray(en_vet_binnato,ITERATION_MAX/larghezza_bin)/(double)(ITERATION_MAX/larghezza_bin)));
+	}
+	autocorrelation(en_vet_dati,en_autocorr,ITERATION_MAX,CORR_MAX);
+	if(f_en_autocorr){
+		for (i = 0; i<CORR_MAX;i++){
+			fprintf(f_en_autocorr,"%d\t%.14e\n",i,en_autocorr[i]);
+		}
+	}
+	autocorrelation(mag_vet_dati,mag_autocorr,ITERATION_MAX,CORR_MAX);
+	if(f_mag_autocorr){
+		for (i = 0; i<CORR_MAX;i++){
+			fprintf(f_mag_autocorr,"%d\t%.14e\n",i,mag_autocorr[i]);
+		}
+	}
+
+
+
+	for ( i=0;i<ITERATION_MAX;i++){
+		fprintf(f_en_temp,"%.14e\n",en_vet_dati[i]);
+	}
+	fprintf(f_mag,"%lf\t%lf\n",BETA,mag_mean);
 	fprintf(f_chi,"%lf\t%lf\n",BETA,chi);
-	fclose(f_mag_mean);
+	fprintf(f_en,"%.14e\t%.14e\n",BETA,en_mean);
+/* Chiusura file */
+	fclose(f_mag_bin);
+	fclose(f_en_bin);
+	fclose(f_en_autocorr);
+	fclose(f_mag);
 	fclose(f_chi);
+	fclose(f_en);
+	fclose(f_en_temp);
+	fclose(f_mag_autocorr);
 	fclose(f_corr_row);
-	free(S_n);
+		/* Free della memoria */
+	free(mag_vet_dati) ;
+	free(mag_vet_binnato);
+	free(en_vet_dati);
+	free(en_vet_binnato);
+	free(en_autocorr);
+	free(mag_autocorr);
 	free(configuration);
 	//printf("Magnetizzazione media: %lf\n",sum/((double) ITERATION_MAX));
 	exit(EXIT_SUCCESS);
diff --git a/ising/metropolis/ising.d b/ising/metropolis/ising.d
index f94f800..dea8f78 100644
--- a/ising/metropolis/ising.d
+++ b/ising/metropolis/ising.d
@@ -1,2 +1,2 @@
 ising.o: ising.c ../include/mtwist.h ../include/constants-metro.h \
- ../include/metropolis.h
+ ../include/metropolis.h ../include/raccolta_dati.h
diff --git a/ising/metropolis/script_multi.py b/ising/metropolis/script_multi.py
index 96fa98f..9dc2eda 100755
--- a/ising/metropolis/script_multi.py
+++ b/ising/metropolis/script_multi.py
@@ -31,16 +31,19 @@ n_lattice = int(sys.argv[4])
 n_core = int(sys.argv[5])
 iteration_per_core= int(n_iteration/n_core)
 step = (x_max - x)/n_iteration
+#Valori di Beta
 allvalues = np.arange(x,x_max,step).tolist()
 if ( n_iteration % n_core != 0):
 	print("Iterazioni multiple del numero di core selezionati(",n_core,")!")
 	sys.exit(1)
 eta_cores = []
+temp_index=0
 for i in range(n_core):
 	temp = []
 	for j in range(iteration_per_core):
-		temp.append([str(allvalues[i]),str(n_lattice)])
-		allvalues.pop(i)
+		temp_index = int(random.random()*len(allvalues))
+		temp.append([str(allvalues[temp_index]),str(n_lattice)])
+		allvalues.pop(temp_index)
 	eta_cores.append(temp)
 jobs=[]
 for i in range(n_core):
diff --git a/ising/modules/metropolis/metropolis.c b/ising/modules/metropolis/metropolis.c
index 2155f12..9bae1df 100644
--- a/ising/modules/metropolis/metropolis.c
+++ b/ising/modules/metropolis/metropolis.c
@@ -73,12 +73,12 @@ inline void metropolis_ising( short int *x, int N , double BETA ){
 	}
 }

-inline double hamiltonian_ising ( short int * configuration, int N){
+inline double hamiltoniana ( short int * configuration, int N){
 	double ham=0;
 	int a,b;
 	for (a = 0; a<N ; a++){
 		for ( b= 0; b<N; b++){
-			ham += J * ( configuration[ ((a+1+N)%N)*N + b]+ configuration[((a-1+N)%N)*N+b]
+			ham += -( configuration[ ((a+1+N)%N)*N + b]+ configuration[((a-1+N)%N)*N+b]
 				+ configuration[a*N+(b+1+N)%N]+configuration[a*N + (b-1+N)%N])*(configuration[a*N +b]);
 		}
 	}
diff --git a/ising/sw/main.c b/ising/sw/main.c
index c2e1b27..dcdae14 100644
--- a/ising/sw/main.c
+++ b/ising/sw/main.c
@@ -27,7 +27,7 @@ int main ( int argc, char * argv[]) {
 		N = atoi(argv[2]);
 	}
 	else{
-		printf("Inserire il valore di Beta\n");
+		printf("Inserire il valore di Beta e N\n");
 		exit(1);
 	}
 	Spin * matrix = (Spin *) malloc(sizeof(Spin)*N*N);
@@ -39,28 +39,32 @@ int main ( int argc, char * argv[]) {
 	}
 	float index_simulation = mt_drand();
 	/***** FILENAMES AND FILE OPENING ******/
-	char mag_file[64] = "";
-	snprintf(mag_file,64,"data/mag_mean%d.dat",N);
-	char chi_file[64] = "";
-	snprintf(chi_file,64,"data/chi%d.dat",N);
-	char mag_file_binning[64] = "";
-	snprintf(mag_file_binning,64,"data/binning/mag_N%d__B%.6lf__%.8lf.dat",N,BETA,index_simulation);
-	char en_file_binning[64] = "";
-	snprintf(en_file_binning,64,"data/binning/en_N%d__B%.6lf__%.8lf.dat",N,BETA,index_simulation);
+	/**** IL NOME DELLA Stringa CONTIENE ----filename----
+	*/
+	char mag_filename[64] = "";
+	snprintf(mag_filename,64,"data/mag_mean%d.dat",N);
+	char chi_filename[64] = "";
+	snprintf(chi_filename,64,"data/chi%d.dat",N);
+	char mag_binning_filename[64] = "";
+	snprintf(mag_binning_filename,64,"data/binning/mag_N%d__B%.6lf.dat",N,BETA);
+	char en_binning_filename[64] = "";
+	snprintf(en_binning_filename,64,"data/binning/en_N%d__B%.6lf.dat",N,BETA);
 	char en_filename[64] = "";
 	snprintf(en_filename,64,"data/en_N%d.dat",N);
-	char en_corr_filename[64] = "";
-	snprintf(en_corr_filename,64,"data/en_autocorrN%d_B%.8lf.dat",N,BETA);
+	char en_autocorr_filename[64] = "";
+	snprintf(en_autocorr_filename,64,"data/en_autocorrN%d_B%.8lf.dat",N,BETA);
 	char en_temp_filename[64] = "data/en_temp.dat";
 	char mag_autocorr_filename[64] = "";
 	snprintf(mag_autocorr_filename,64,"data/mag_autocorrN%d_B%.8lf.dat",N,BETA);
-	FILE * f_mag_mean = fopen(mag_file,"a");
-	FILE * f_chi = fopen(chi_file,"a");
-	FILE * mag_bin_file = fopen(mag_file_binning,"w");
-	FILE * en_bin_file = fopen(en_file_binning,"w");
-	FILE * en_corr_file = fopen(en_corr_filename,"w");
-	FILE * en_file = fopen(en_filename,"a");
-	FILE * en_temp_file = fopen(en_temp_filename,"w");
+
+	/*** I File sono chiamati: f_$(Nomestringa) ****/
+	FILE * f_mag = fopen(mag_filename,"a");
+	FILE * f_chi = fopen(chi_filename,"a");
+	FILE * f_mag_bin = fopen(mag_binning_filename,"w");
+	FILE * f_en_bin = fopen(en_binning_filename,"w");
+	FILE * f_en_autocorr = fopen(en_autocorr_filename,"w");
+	FILE * f_en = fopen(en_filename,"a");
+	FILE * f_en_temp = fopen(en_temp_filename,"w");
 	FILE * f_mag_autocorr = fopen(mag_autocorr_filename,"w");
 	/*Start*/
 	spin_init(matrix,nodes,N);
@@ -93,20 +97,20 @@ int main ( int argc, char * argv[]) {
 	en_mean /= (double)(ITERATION_MAX);
 	// BINNING E DATI VARI
 	int larghezza_bin;
-	mag_vet_binnato = malloc(sizeof(double)*(ITERATION_MAX/2));
-	en_vet_binnato = malloc(sizeof(double)*(ITERATION_MAX/2));
-	for ( larghezza_bin = 2; larghezza_bin < 100 ; larghezza_bin+=2){
+	mag_vet_binnato = malloc(sizeof(double)*(ITERATION_MAX));
+	en_vet_binnato = malloc(sizeof(double)*(ITERATION_MAX));
+	for ( larghezza_bin = 1; larghezza_bin < 100 ; larghezza_bin+=1){
 		binning(mag_vet_dati,mag_vet_binnato,ITERATION_MAX,larghezza_bin);
 		binning(en_vet_dati,en_vet_binnato,ITERATION_MAX,larghezza_bin);
-		fprintf(mag_bin_file,"%d\t%.14e\n", larghezza_bin,
+		fprintf(f_mag_bin,"%d\t%.14e\n", larghezza_bin,
 			sqrt(varianceOfDoubleArray(mag_vet_binnato,ITERATION_MAX/larghezza_bin)/(double)(ITERATION_MAX/larghezza_bin)));
-		fprintf(en_bin_file,"%d\t%.14e\n", larghezza_bin,
+		fprintf(f_en_bin,"%d\t%.14e\n", larghezza_bin,
 			sqrt(varianceOfDoubleArray(en_vet_binnato,ITERATION_MAX/larghezza_bin)/(double)(ITERATION_MAX/larghezza_bin)));
 	}
 	autocorrelation(en_vet_dati,en_autocorr,ITERATION_MAX,CORR_MAX);
-	if(en_corr_file){
+	if(f_en_autocorr){
 		for (i = 0; i<CORR_MAX;i++){
-			fprintf(en_corr_file,"%d\t%.14e\n",i,en_autocorr[i]);
+			fprintf(f_en_autocorr,"%d\t%.14e\n",i,en_autocorr[i]);
 		}
 	}
 	autocorrelation(mag_vet_dati,mag_autocorr,ITERATION_MAX,CORR_MAX);
@@ -119,20 +123,20 @@ int main ( int argc, char * argv[]) {

 	for ( i=0;i<ITERATION_MAX;i++){
-		fprintf(en_temp_file,"%.14e\n",en_vet_dati[i]);
+		fprintf(f_en_temp,"%.14e\n",en_vet_dati[i]);
 	}
 	printf("BETA: %lf , mag2: %.6e \t mag*mag: %.6e\t mag:%.6e\n",BETA,mag2_mean, mag_mean*mag_mean,mag_mean);
-	fprintf(f_mag_mean,"%.14e\t%.14e\n",BETA,mag_mean);
+	fprintf(f_mag,"%.14e\t%.14e\n",BETA,mag_mean);
 	fprintf(f_chi,"%.14e\t%.14e\n",BETA,chi);
-	fprintf(en_file,"%.14e\t%.14e\n",BETA,en_mean);
+	fprintf(f_en,"%.14e\t%.14e\n",BETA,en_mean);
  	/* Chiusura file */
-	fclose(mag_bin_file);
-	fclose(en_bin_file);
-	fclose(en_corr_file);
-	fclose(f_mag_mean);
+	fclose(f_mag_bin);
+	fclose(f_en_bin);
+	fclose(f_en_autocorr);
+	fclose(f_mag);
 	fclose(f_chi);
-	fclose(en_file);
-	fclose(en_temp_file);
+	fclose(f_en);
+	fclose(f_en_temp);
 	fclose(f_mag_autocorr);
 	/* Free della memoria */
 	free(mag_vet_dati) ;
diff --git a/ising/sw/script_multi.py b/ising/sw/script_multi.py
index 4249205..6eb7436 100755
--- a/ising/sw/script_multi.py
+++ b/ising/sw/script_multi.py
@@ -36,11 +36,13 @@ if ( n_iteration % n_core != 0):
 	print("Iterazioni multiple del numero di core selezionati(",n_core,")!")
 	sys.exit(1)
 eta_cores = []
+temp_index = 0
 for i in range(n_core):
 	temp = []
 	for j in range(iteration_per_core):
-		temp.append([str(allvalues[i]),str(n_lattice)])
-		allvalues.pop(i)
+		temp_index = int(random.random()*len(allvalues))
+		temp.append([str(allvalues[temp_index]),str(n_lattice)])
+		allvalues.pop(temp_index)
 	eta_cores.append(temp)
 jobs=[]
 for i in range(n_core):