better check and checkmate functions