- Added docstrings and comments.
- Renamed 'board' to 'grid'.