added comments and extra proximity checking. Segmentation fault persists, but about 1 in 10 times a valid board is actually generated