working on averaging