code sample for trivia generator