produces exact same outputs to samples, except one of the error cases.