make output identical for both codes