Improved board data structure and functions.