script now sorts output by destination id.