some test code for Reorder, plus Reorder bugs fixed