outline of implementation for JointDecoder, but don't expect it to compile