some cleaning up/fixing in light.c