rework of the demonstration script 'twilight'