added tests for trivia game and cleaned up some parts of the code