Added a check for board dimensions that are less than the provided dim-argument
- added tests