Redid the way in which the fog distance code is injected