encoding/decoding of boards