implemented flow unrolling
same state as the labwindows cvi software