implemented toArray method for Board