The heavily armed carrack, first developed in Portugal for either trade or war in the Atlantic Ocean, was the precursor of the "ship of the line". Other maritime European states quickly adopted it in the late 15th and early 16th centuries. These vessels were developed by fusing aspects of the cog of the North Sea and galley of the Mediterranean Sea. The cogs, which traded in the North Sea, in the Baltic Sea and along the Atlantic coasts, had an advantage over galleys in battle because they had raised platforms called "castles" at bow and stern that archers could occupy to fire down on enemy ships or even to drop heavy weights from. Over time these castles became higher and larger, and eventually were built into the structure of the ship, increasing overall strength. This aspect of the cog remained in the newer-style carrack designs and proved its worth in battles like that at Diu in 1509.