Added decode functionality.