re-abstracted lights.c