process_lights func