improved opponent algorithm