rationalised some functions started on kingInCheck logic