public void execute(final State state) {
		// don't bother if we don't know where the enemy is
		if (state.targetPosition == null) {
			return;
		}
		this.state = state;

		updateWaves();
		
		// calculate some basic gun stuff
		final double angle = next.angleTo(state.targetPosition);
		final double bulletPower = getBulletPower();
		final GunWave wave = createWave(bulletPower, angle);
		wave.data = new GunFormula(wave, state);
		wave.data.weight = 0.1;
		
		// turn the gun (if < 5 turns till fire)
		double offset = 0;
		if(state.robotGunHeat/State.coolingRate < 5) {
			//get the aim offset
			offset = getBestAngleOffset(wave);
		}
		bot.setTurnGun(Utils.normalRelativeAngle(angle - state.robotGunHeading + offset));
		
		if(state.robotEnergy > bulletPower && Math.abs(state.robotGunTurnRemaining) < 0.001) {
			Bullet b = bot.setFire(bulletPower);
			
			// fire gun and create new waves
			if (b != null) {
				wave.data.weight = 1.0;
			}
		}
		
		waves.add(wave);
	}