rewriting to python-chess