Moved averaging to before any barrierHit test. Seems to work.