Rough out initial translation from Baddger code

(untested--and probably not working)