slight changes to produce output identical to sample