Implementing `decode` -- WIP