Moved rankstep from init_seed to writetrajs to fix a circular dependencey.