Add decode implementation