added some more controls over correct number of board, so that we are sure we do not ever address an array out of it bounds