order_at function imporved. Changes are same as done in merge_cds