modified ASNEncoder