A working model of chess