 Bombs launched from trebuchet catapults mounted on forecastles of naval ships ensured the victory of Song over Jin forces at the Battle of Caishi in 1161, while the Mongol Yuan Dynasty (1271–1368) during their failed invasion of Japan in 1274 and 1281.During the 13th and 14th centuries, gunpowder formulas became more potent (with nitrate levels of up to 91%) and gunpowder weaponry more advanced and deadly, as evidenced in the Ming Dynasty (1368–1644) military manuscript "Huolongjing" compiled by Jiao Yu (fl.14th to early 15th century) and Liu Bowen (1311–1375).