major optimization, caching positions of the kings! (about 20%!!!! )