Added functionality for the submit and exit buttons. Also, added a
counter for the number of trials and if after the third trial, the app
will change the word.