add decode functionality