complete refactor + added decode
fixed bad package.json
bug fixes + optimisation