inner function now
tree search works! Helped me find a few erros in my code, but the beast plays now!!!