Do you realy mean for the code that converts the board into a binary string to be destructive? (I mean the board ends up as zeroes)

There are many easy ways to correct this, if your only problem...