Rough out initial translation from Baddger code