modified bufStruct average calculation for better values