internal traces removed
some loop fixes