finalized reindex() and commflag(). both are ready to test.