made changes with functions

Add functions addbuttons, ansquestions, and nexquestion.