draft 3

added global var, added functions, fixed new game button, made
buttonClick more readable.