changed algorith to negamax