removed global use for GroundDistance, use direct assignment