Implemented averagingIn