wou_stepgen.c: clean up code