Moved the board initialization stuff to its own function.