Average calculation
Merge commit '63b648586296c8ec16fdb026eb4aacef10713d91'
cleanup and reformat of code