Completes ischeck function, needs debugging. Begins work on ismate, a checkmate function