made this runable from the command line, fixed bug in board