untested isCheckMate() function added