Butched some board generation from stack overflow (but it's not working though)