slub77, have you considered reducing all the text events to one? You can use $ulevel = levelnum in if and then elseif. You have many repetitions, too.