added rolling average, revised pac.udate