the japanese navy enjoyed spectacular success during the first part of the hostilities, but american forces ultimately managed to gain the upper hand through decrypting the japanese naval codes, exploiting the aforementioned japanese neglect of fleet defense, technological upgrades to its air and naval forces, superior personnel management such as routinely reassigning accomplished combat pilots to provide experienced training of new recruits, and a vastly stronger industrial output. japan's reluctance to use their submarine fleet for commerce raiding and failure to secure their communications also added to their defeat. during the last phase of the war the imperial japanese navy resorted to a series of desperate measures, including kamikaze (suicide) actions, which ultimately not only proved futile in repelling the allies, but encouraged those enemies to use their newly developed atomic bombs to defeat japan without the anticipated costly battles against so fanatical a defence.