Added checkmate code