fixed reverse-order gen bug.  add random order conversion