created  countFlags() in GameBoard class on line 274