wagner wrote the librettos for his `` ring '' cycle backwards , adding the `` back story '' that would make sense of `` siegfried '' and `` die gotterdammerung '' but wagner had the advantage of writing the music in order , and of knowing he was composing a vast , unprecedented cycle of works .