added basic checkmate detection