decode function ported :relieved: basic functions added :godmode: