For more information you can read this short blog post that explains how I managed to write the utility.
Andrews, I. (2025) Protector of the Gulf. Advances in Historical Studies, 14, 280-301. doi: 10.4236/ahs.2025.144016 .