Adding logic for value and board