Fixed serious bugs and added the correlation matrix of the input data in the statistics