negamax implementation based on wikipedia. Does not work very well also slow