I need to fix the last two by splitting up encode into multiple functions (probably a good thing) and apparently changing the lazy static macro