minor util for moving avg