Fixed big bug in gentrain_dist2 which may not properly pair input-output message pairs.
Fixed big bug in gentrain_dist2 which may not properly pair input-output message pairs.

wittawatj/kernel-ep,wittawatj/kernel-ep