averaging simulation