Updated alpha beta algorithm