added logic to opponent