Implement decode.