Function to calculate all the statistics and migration