A bit of work on checkmate algorithm