add decode support. Closes #1