fixing decoder... encode should be fine.
option 4 all complete and tested, ready to be pulled in