simulate loop and clock var