Unofficial edits to Malkuth's version of Ubioweld's code