Implement `decode`