if(damage <= 0.0 || group <=0.0) return final_multiplier;
    public static double punchThroughMod (Entity target, IGame g, int hit_table, int hit_side,            double damage, double group){                int armor_values[] = new int[8];        int max_index = 1;        armor_values[0] = 0;                // Set the final multiplier as 1.0 (no chance of penetrating armor)        double final_multiplier = 1.0;                // Set the base multiplier as 0.5 (good bonus for penetrating with a single hit)        double base_multiplier = 0.5;                // If the target is a Mech        if (target instanceof Mech){            // Create vector of body locations with targets current armor values            // Use hit table and direction to determine locations that are hit            if (hit_table == ToHitData.HIT_NORMAL){                max_index = 7;                armor_values[0] = target.getArmor(Mech.LOC_HEAD,false);                if (hit_side != ToHitData.SIDE_FRONT){                armor_values[1] = target.getArmor(Mech.LOC_CT,true);                } else {                    armor_values[1] = target.getArmor(Mech.LOC_CT,false);                }                if (hit_side != ToHitData.SIDE_FRONT){                    armor_values[2] = target.getArmor(Mech.LOC_RT,true);                } else {                    armor_values[2] = target.getArmor(Mech.LOC_RT,false);                }                if (hit_side != ToHitData.SIDE_FRONT){                    armor_values[3] = target.getArmor(Mech.LOC_LT,true);                } else {                    armor_values[3] = target.getArmor(Mech.LOC_LT,false);                }                armor_values[4] = target.getArmor(Mech.LOC_RARM,false);                armor_values[5] = target.getArmor(Mech.LOC_LARM,false);                armor_values[6] = target.getArmor(Mech.LOC_RLEG,false);                armor_values[7] = target.getArmor(Mech.LOC_RLEG,false);            }            if (hit_table == ToHitData.HIT_PUNCH){                armor_values[0] = target.getArmor(Mech.LOC_HEAD,false);                if (hit_side == ToHitData.SIDE_RIGHT){                    max_index = 3;                    armor_values[1] = target.getArmor(Mech.LOC_CT,false);                    armor_values[2] = target.getArmor(Mech.LOC_RT,false);                    armor_values[3] = target.getArmor(Mech.LOC_RARM,false);                }                if (hit_side == ToHitData.SIDE_LEFT){                    max_index = 3;                    armor_values[1] = target.getArmor(Mech.LOC_CT,false);                    armor_values[2] = target.getArmor(Mech.LOC_LT,false);                    armor_values[3] = target.getArmor(Mech.LOC_LARM,false);                }                if (hit_side == ToHitData.SIDE_FRONT){                    max_index = 5;                    armor_values[1] = target.getArmor(Mech.LOC_CT,false);                    armor_values[2] = target.getArmor(Mech.LOC_RT,false);                    armor_values[3] = target.getArmor(Mech.LOC_LT,false);                    armor_values[4] = target.getArmor(Mech.LOC_RARM,false);                    armor_values[5] = target.getArmor(Mech.LOC_LARM,false);                }                if (hit_side == ToHitData.SIDE_REAR){                    max_index = 5;                    armor_values[1] = target.getArmor(Mech.LOC_CT,true);                    armor_values[2] = target.getArmor(Mech.LOC_RT,true);                    armor_values[3] = target.getArmor(Mech.LOC_LT,true);                    armor_values[4] = target.getArmor(Mech.LOC_RARM,false);                    armor_values[5] = target.getArmor(Mech.LOC_LARM,false);                }            }            if (hit_table == ToHitData.HIT_KICK){                max_index = -1;                if ((hit_side == ToHitData.SIDE_FRONT) || (hit_side == ToHitData.SIDE_REAR) ||                        (hit_side == ToHitData.SIDE_RIGHT)){                    max_index++;                    armor_values[max_index] = target.getArmor(Mech.LOC_RLEG,false);                }                if ((hit_side == ToHitData.SIDE_FRONT) || (hit_side == ToHitData.SIDE_REAR) ||                        (hit_side == ToHitData.SIDE_LEFT)){                    max_index++;                    armor_values[max_index] = target.getArmor(Mech.LOC_LLEG,false);                }            }        }        // If the target is a ProtoMech        if (target instanceof Protomech){            max_index = 6;            // Create vector of body locations with targets current armor values            // Create two high-armor dummy locations to represent the 'near miss' hit locations            armor_values[0] = target.getArmor(Protomech.LOC_TORSO, false);            armor_values[1] = target.getArmor(Protomech.LOC_LEG, false);            armor_values[2] = target.getArmor(Protomech.LOC_RARM, false);            armor_values[3] = target.getArmor(Protomech.LOC_LARM, false);            armor_values[4] = target.getArmor(Protomech.LOC_HEAD, false);            armor_values[5] = 100;            armor_values[6] = 100;            if (((Protomech)target).hasMainGun()){                max_index++;                armor_values[max_index] = target.getArmor(Protomech.LOC_MAINGUN, false);            }        }        // If the target is a vehicle        if (target instanceof Tank){            // Create vector of armor locations            max_index = 0;            if (hit_side == ToHitData.SIDE_FRONT){                armor_values[0] = target.getArmor(Tank.LOC_FRONT);            }            if (hit_side == ToHitData.SIDE_RIGHT){                armor_values[0] = target.getArmor(Tank.LOC_RIGHT);            }            if (hit_side == ToHitData.SIDE_LEFT){                armor_values[0] = target.getArmor(Tank.LOC_LEFT);            }            if (hit_side == ToHitData.SIDE_REAR){                armor_values[0] = target.getArmor(Tank.LOC_REAR);            }            if (!(((Tank)target).hasNoTurret())){                max_index++;                armor_values[max_index] = target.getArmor(Tank.LOC_TURRET);            }        }        // If the target is Battle Armor        if (target instanceof BattleArmor){            // Create vector of armor of surviving troopers            max_index = -1;            for (int i=1; i < ((BattleArmor)target).getShootingStrength(); i++){                if (target.getArmor(i) >= 0){                    max_index++;                    armor_values[max_index] = target.getArmor(i);                }            }        }        // If the target is conventional infantry        if ((target instanceof Infantry) && !(target instanceof BattleArmor)){            // Create a single element vector with total number of troopers            max_index = 0;            armor_values[0] = ((Infantry)target).getShootingStrength();        }                double hit_total = group;        // While hit damage is less than total damage applied, increment by group value        for (; hit_total <= damage; hit_total += group){            for (int i = 0; i <= max_index; i++){                // If hit damage can penetrate location                if (hit_total > armor_values[i]){                    final_multiplier += base_multiplier;                }            }            base_multiplier = base_multiplier/2;        }                // Return final multiplier                return final_multiplier;            }