mean_storage function