Average calculation

removing transition and using more accurate average calculation