more work on decoding
now it really really should work (but still doesn't always)