Added decode functionality and decode each position functionality