added king logic