Improved lighting experiment code