added some logic to board control