cleanup
kludgy looping with doLooping