Theory and practice of chess endings