added negamax function and implementation