Update and optimisation

I noticed that I recreate and reassign the array of buttons every time
a button is clicked which is completely unnecessary and wrong. So I
changed the variable to be global and moved the assigning inside the
init function plus I noticed that the marker array is being used only
within the init function and never reused by any other function so
there is no need to create the variable globally outside the scope of
the init function.