Tried finding a way to check if a square exists, no luck so far.
Drew an ASCII picture of the squares that surround myButton.
tidied code up a bit.