script now works.
Note that the categories applied  are based on the words in the trialfun (which has cut out the last words at the end of each sequence).