Generally fixed the code. Will compile and work now. Also cleaned up the board.py to be a bit more readable at parts.