Working on checkmate logic