recursive decoding debugged / updated