decode: add function documentation