Made kings trigger checking, refactoring pt. 1
fixed merge error