refactored to add dates, added averaging based on a max number of points.