Added decode functionality