added machinery to compute average values over large iterations
Completed homework 1 coding