Code cleanup and reorganization,
+light attenuation.