Adjusted page script to update totals and averages