factor out calculate_attack_vector function