first pass reordering