Tweaked light stack code