Adding average code
Fix merge