Created initialize method to check if a board input is valid.