fix import order
pass on updated LoopState as well in loop0 reimplementation