to merge with king
merged with king. takes time to respond. find way to shorten runtime