Rewrote loop->clock
Fixed migration issue