fixed numbering error introduced by random ordering.