loop derivation modif complete, some tests pass