added output of statistics and calculation of equilibrium (incomplete)