Ok now I think decode works, but can't run tests yet because encode is needed