modified print encode