resurrect encoding wip