added implementation of inCheckMate

uses a helper function doesMoveExist.