Changed tridigital encode routine to eliminate 'trans' call and to
return more information.