Starting to transition this to working with arbitrary board sizes.